<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chapter 26 MySQL sys Schema</title>
<link rel="stylesheet" href="mvl.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets + chunker.py v1.9.2" />
<link rel="start" href="index.html" title="{book-title}" />
<link rel="up" href="" title="" />
<link rel="prev" href="performance-schema.html" title="Chapter 25 MySQL Performance Schema" />
<link rel="next" href="connectors-apis.html" title="Chapter 27 Connectors and APIs" />
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Chapter 26 MySQL sys Schema</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="performance-schema.html">Prev</a> </td>
<th width="60%" align="center"></th>
<td width="20%" align="right"> <a accesskey="n" href="connectors-apis.html">Next</a></td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="sys-schema"></a>Chapter 26 MySQL sys Schema</h1>

</div>

</div>

</div>
<div class="toc">
<p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="sys-schema.html#sys-schema-prerequisites">26.1 Prerequisites for Using the sys Schema</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-usage">26.2 Using the sys Schema</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-progress-reporting">26.3 sys Schema Progress Reporting</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-reference">26.4 sys Schema Object Reference</a></span></dt><dd><dl><dt><span class="section"><a href="sys-schema.html#sys-schema-object-index">26.4.1 sys Schema Object Index</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-tables">26.4.2 sys Schema Tables and Triggers</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-views">26.4.3 sys Schema Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-procedures">26.4.4 sys Schema Stored Procedures</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-functions">26.4.5 sys Schema Stored Functions</a></span></dt></dl></dd></dl>
</div>
<p>
    MySQL 8.0 includes the
    <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema, a set of objects that
    helps DBAs and developers interpret data collected by the
    Performance Schema. <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema objects
    can be used for typical tuning and diagnosis use cases. Objects in
    this schema include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        Views that summarize Performance Schema data into more easily
        understandable form.
      </p></li><li class="listitem"><p>
        Stored procedures that perform operations such as Performance
        Schema configuration and generating diagnostic reports.
      </p></li><li class="listitem"><p>
        Stored functions that query Performance Schema configuration and
        provide formatting services.
</p></li></ul>
</div>
<p>
    For new installations, the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema
    is installed by default during data directory initialization if you
    use <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with the
    <a class="link" href="server-administration.html#option_mysqld_initialize"><code class="option">--initialize</code></a> or
    <a class="link" href="server-administration.html#option_mysqld_initialize-insecure"><code class="option">--initialize-insecure</code></a> option. If this
    is not desired, you can drop the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a>
    schema manually after initialization if it is unneeded.
  </p><p>
    <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> returns an error if a
    <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema exists but has no
    <a class="link" href="sys-schema.html#sys-version" title="26.4.3.47 The version View"><code class="literal">version</code></a> view, on the assumption that
    absence of this view indicates a user-created <code class="literal">sys</code>
    schema. To upgrade in this case, remove or rename the existing
    <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema first.
  </p><a class="indexterm" name="idm139899466337344"></a><p>
    <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema objects have a
    <code class="literal">DEFINER</code> of
    <code class="literal">'mysql.sys'@'localhost'</code>. Use of the dedicated
    <code class="literal">mysql.sys</code> account avoids problems that occur if a
    DBA renames or removes the <code class="literal">root</code> account.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="sys-schema-prerequisites"></a>26.1 Prerequisites for Using the sys Schema</h2>
</div>
</div>
</div>
<p>
      Before using the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema, the
      prerequisites described in this section must be satisfied.
    </p><p>
      Because the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema provides an
      alternative means of accessing the Performance Schema, the
      Performance Schema must be enabled for the
      <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema to work. See
      <a class="xref" href="performance-schema.html#performance-schema-startup-configuration" title="25.3 Performance Schema Startup Configuration">Section 25.3, “Performance Schema Startup Configuration”</a>.
    </p><p>
      For full access to the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema, a
      user must have these privileges:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a> on all
          <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> tables and views
        </p></li><li class="listitem"><p>
          <a class="link" href="security.html#priv_execute"><code class="literal">EXECUTE</code></a> on all
          <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> stored procedures and
          functions
        </p></li><li class="listitem"><p>
          <a class="link" href="security.html#priv_insert"><code class="literal">INSERT</code></a> and
          <a class="link" href="security.html#priv_update"><code class="literal">UPDATE</code></a> for the
          <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table, if changes are
          to be made to it
        </p></li><li class="listitem"><p>
          Additional privileges for certain
          <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema stored procedures and
          functions, as noted in their descriptions; for example, the
          <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a> procedure
</p></li></ul>
</div>
<p>
      It is also necessary to have privileges for the objects underlying
      the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema objects:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a> on any Performance
          Schema tables accessed by <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a>
          schema objects, and <a class="link" href="security.html#priv_update"><code class="literal">UPDATE</code></a> for
          any tables to be updated using
          <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema objects
        </p></li><li class="listitem"><p>
          <a class="link" href="security.html#priv_process"><code class="literal">PROCESS</code></a> for the
          <code class="literal">INFORMATION_SCHEMA</code>
          <a class="link" href="information-schema.html#innodb-buffer-page-table" title="24.33.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table"><code class="literal">INNODB_BUFFER_PAGE</code></a> table
</p></li></ul>
</div>
<p>
      Certain Performance Schema instruments and consumers must be
      enabled and (for instruments) timed to take full advantage of
      <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema capabilities:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          All <code class="literal">wait</code> instruments
        </p></li><li class="listitem"><p>
          All <code class="literal">stage</code> instruments
        </p></li><li class="listitem"><p>
          All <code class="literal">statement</code> instruments
        </p></li><li class="listitem"><p>
          <code class="literal"><em class="replaceable"><code>xxx</code></em>_current</code> and
          <code class="literal"><em class="replaceable"><code>xxx</code></em>_history_long</code>
          consumers for all events
</p></li></ul>
</div>
<p>
      You can use the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema itself to
      enable all of the additional instruments and consumers:
    </p><pre data-lang="sql" class="programlisting">
CALL sys.ps_setup_enable_instrument('wait');
CALL sys.ps_setup_enable_instrument('stage');
CALL sys.ps_setup_enable_instrument('statement');
CALL sys.ps_setup_enable_consumer('current');
CALL sys.ps_setup_enable_consumer('history_long');
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        For many uses of the <code class="literal">sys</code> schema, the default
        Performance Schema is sufficient for data collection. Enabling
        all the instruments and consumers just mentioned has a
        performance impact, so it is preferable to enable only the
        additional configuration you need. Also, remember that if you
        enable additional configuration, you can easily restore the
        default configuration like this:
      </p><pre data-lang="sql" class="programlisting">
CALL sys.ps_setup_reset_to_default(TRUE);
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="sys-schema-usage"></a>26.2 Using the sys Schema</h2>

</div>

</div>

</div>
<p>
      You can make the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema the
      default schema so that references to its objects need not be
      qualified with the schema name:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>USE sys;</code></strong>
Database changed
mysql&gt; <strong class="userinput"><code>SELECT * FROM version;</code></strong>
+-------------+---------------------+
| sys_version | mysql_version       |
+-------------+---------------------+
| 1.6.0       | 8.0.2-dmr-debug-log |
+-------------+---------------------+
</pre><p>
      (The <a class="link" href="sys-schema.html#sys-version" title="26.4.3.47 The version View"><code class="literal">version</code></a> view shows the
      <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema and MySQL server
      versions.)
    </p><p>
      To access <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema objects while a
      different schema is the default (or simply to be explicit),
      qualify object references with the schema name:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM sys.version;</code></strong>
+-------------+---------------------+
| sys_version | mysql_version       |
+-------------+---------------------+
| 1.6.0       | 8.0.2-dmr-debug-log |
+-------------+---------------------+
</pre><p>
      Examples in this chapter usually assume
      <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> as the default schema.
    </p><p>
      The <code class="literal">sys</code> schema contains many views that
      summarize Performance Schema tables in various ways. Most of these
      views come in pairs, such that one member of the pair has the same
      name as the other member, plus a <code class="literal">x$</code> prefix. For
      example, the <a class="link" href="sys-schema.html#sys-host-summary-by-file-io" title="26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views"><code class="literal">host_summary_by_file_io</code></a>
      view summarizes file I/O grouped by host and displays latencies
      converted from picoseconds to more readable values (with units);
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM host_summary_by_file_io;</code></strong>
+------------+-------+------------+
| host       | ios   | io_latency |
+------------+-------+------------+
| localhost  | 67570 | 5.38 s     |
| background |  3468 | 4.18 s     |
+------------+-------+------------+
</pre><p>
      The <a class="link" href="sys-schema.html#sys-host-summary-by-file-io" title="26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views"><code class="literal">x$host_summary_by_file_io</code></a> view
      summarizes the same data but displays unformatted picosecond
      latencies:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM x$host_summary_by_file_io;</code></strong>
+------------+-------+---------------+
| host       | ios   | io_latency    |
+------------+-------+---------------+
| localhost  | 67574 | 5380678125144 |
| background |  3474 | 4758696829416 |
+------------+-------+---------------+
</pre><p>
      The view without the <code class="literal">x$</code> prefix is intended to
      provide output that is more user friendly and easier for humans to
      read. The view with the <code class="literal">x$</code> prefix that displays
      the same values in raw form is intended more for use with other
      tools that perform their own processing on the data. For
      additional information about the differences between
      non-<code class="literal">x$</code> and <code class="literal">x$</code> views, see
      <a class="xref" href="sys-schema.html#sys-schema-views" title="26.4.3 sys Schema Views">Section 26.4.3, “sys Schema Views”</a>.
    </p><p>
      To examine <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema object
      definitions, use the appropriate
      <a class="link" href="sql-syntax.html#show" title="13.7.6 SHOW Syntax"><code class="literal">SHOW</code></a> statement or
      <a class="link" href="information-schema.html" title="Chapter 24 INFORMATION_SCHEMA Tables"><code class="literal">INFORMATION_SCHEMA</code></a> query. For
      example, to examine the definitions of the
      <a class="link" href="sys-schema.html#sys-session" title="26.4.3.33 The session and x$session Views"><code class="literal">session</code></a> view and
      <a class="link" href="sys-schema.html#sys-format-bytes" title="26.4.5.3 The format_bytes() Function"><code class="literal">format_bytes()</code></a> function, use these
      statements:
    </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SHOW CREATE VIEW session;</code></strong>
mysql&gt; <strong class="userinput"><code>SHOW CREATE FUNCTION format_bytes;</code></strong>
</pre><p>
      However, those statements display the definitions in relatively
      unformatted form. To view object definitions with more readable
      formatting, access the individual <code class="filename">.sql</code> files
      available from the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema
      development website at
      <a class="ulink" href="https://github.com/mysql/mysql-sys" target="_top">https://github.com/mysql/mysql-sys</a>.
    </p><p>
      Neither <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> nor
      <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> dump the
      <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema by default. To generate a
      dump file, name the <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema
      explicitly on the command line using either of these commands:
    </p><pre data-lang="terminal" class="programlisting">
mysqldump --databases --routines sys &gt; sys_dump.sql
mysqlpump sys &gt; sys_dump.sql
</pre><p>
      To reinstall the schema from the dump file, use this command:
    </p><pre data-lang="terminal" class="programlisting">
mysql &lt; sys_dump.sql
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="sys-schema-progress-reporting"></a>26.3 sys Schema Progress Reporting</h2>

</div>

</div>

</div>
<p>
      The following <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema views
      provide progress reporting for long-running transactions:
    </p><pre data-lang="none" class="programlisting">
processlist
session
x$processlist
x$session
</pre><p>
      Assuming that the required instruments and consumers are enabled,
      the <code class="literal">progress</code> column of these views shows the
      percentage of work completed for stages that support progress
      reporting.
    </p><p>
      Stage progress reporting requires that the
      <code class="literal">events_stages_current</code> consumer be enabled, as
      well as the instruments for which progress information is desired.
      Instruments for these stages currently support progress reporting:
    </p><pre data-lang="none" class="programlisting">
stage/sql/Copying to tmp table
stage/innodb/alter table (end)
stage/innodb/alter table (flush)
stage/innodb/alter table (insert)
stage/innodb/alter table (log apply index)
stage/innodb/alter table (log apply table)
stage/innodb/alter table (merge sort)
stage/innodb/alter table (read PK and internal sort)
stage/innodb/buffer pool load
</pre><p>
      For stages that do not support estimated and completed work
      reporting, or if the required instruments or consumers are not
      enabled, the <code class="literal">progress</code> column is
      <code class="literal">NULL</code>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="sys-schema-reference"></a>26.4 sys Schema Object Reference</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="sys-schema.html#sys-schema-object-index">26.4.1 sys Schema Object Index</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-tables">26.4.2 sys Schema Tables and Triggers</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-views">26.4.3 sys Schema Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-procedures">26.4.4 sys Schema Stored Procedures</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-functions">26.4.5 sys Schema Stored Functions</a></span></dt></dl>
</div>
<p>
      The <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema includes tables and
      triggers, views, and stored procedures and functions. The
      following sections provide details for each of these objects.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="sys-schema-object-index"></a>26.4.1 sys Schema Object Index</h3>
</div>
</div>
</div>
<p>
        The following tables list <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a>
        schema objects and provide a short description of each one.
</p>
<div class="table">
<a name="sys-schema-tables-table"></a><p class="title"><b>Table 26.1 sys Schema Tables and Triggers</b></p>
<div class="table-contents">
<table summary="Tables and triggers used in the sys schema implementation"><col width="60%"><col width="40%"><thead><tr>
            <th align="center" scope="col">Table or Trigger Name</th>
            <th align="center" scope="col">Description</th>
          </tr></thead><tbody><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a></td>
            <td align="left"><a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema configuration options</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-sys-config-insert-set-user" title="26.4.2.2 The sys_config_insert_set_user Trigger"><code class="literal">sys_config_insert_set_user</code></a></td>
            <td align="left"><a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> insert trigger</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-sys-config-update-set-user" title="26.4.2.3 The sys_config_update_set_user Trigger"><code class="literal">sys_config_update_set_user</code></a></td>
            <td align="left"><a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> update trigger</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="table">
<a name="sys-schema-views-table"></a><p class="title"><b>Table 26.2 sys Schema Views</b></p>
<div class="table-contents">
<table summary="Views used in the sys schema implementation"><col width="60%"><col width="40%"><thead><tr>
            <th align="center" scope="col">View Name</th>
            <th align="center" scope="col">Description</th>
          </tr></thead><tbody><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-host-summary" title="26.4.3.1 The host_summary and x$host_summary Views"><code class="literal">host_summary</code></a>,
              <a class="link" href="sys-schema.html#sys-host-summary" title="26.4.3.1 The host_summary and x$host_summary Views"><code class="literal">x$host_summary</code></a></td>
            <td align="left">Statement activity, file I/O, and connections, grouped by host</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-host-summary-by-file-io" title="26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views"><code class="literal">host_summary_by_file_io</code></a>,
              <a class="link" href="sys-schema.html#sys-host-summary-by-file-io" title="26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views"><code class="literal">x$host_summary_by_file_io</code></a></td>
            <td align="left">File I/O, grouped by host</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-host-summary-by-file-io-type" title="26.4.3.3 The host_summary_by_file_io_type and x$host_summary_by_file_io_type Views"><code class="literal">host_summary_by_file_io_type</code></a>,
              <a class="link" href="sys-schema.html#sys-host-summary-by-file-io-type" title="26.4.3.3 The host_summary_by_file_io_type and x$host_summary_by_file_io_type Views"><code class="literal">x$host_summary_by_file_io_type</code></a></td>
            <td align="left">File I/O, grouped by host and event type</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-host-summary-by-stages" title="26.4.3.4 The host_summary_by_stages and x$host_summary_by_stages Views"><code class="literal">host_summary_by_stages</code></a>,
              <a class="link" href="sys-schema.html#sys-host-summary-by-stages" title="26.4.3.4 The host_summary_by_stages and x$host_summary_by_stages Views"><code class="literal">x$host_summary_by_stages</code></a></td>
            <td align="left">Statement stages, grouped by host</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-host-summary-by-statement-latency" title="26.4.3.5 The host_summary_by_statement_latency and x$host_summary_by_statement_latency Views"><code class="literal">host_summary_by_statement_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-host-summary-by-statement-latency" title="26.4.3.5 The host_summary_by_statement_latency and x$host_summary_by_statement_latency Views"><code class="literal">x$host_summary_by_statement_latency</code></a></td>
            <td align="left">Statement statistics, grouped by host</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-host-summary-by-statement-type" title="26.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type Views"><code class="literal">host_summary_by_statement_type</code></a>,
              <a class="link" href="sys-schema.html#sys-host-summary-by-statement-type" title="26.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type Views"><code class="literal">x$host_summary_by_statement_type</code></a></td>
            <td align="left">Statements executed, grouped by host and statement</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-innodb-buffer-stats-by-schema" title="26.4.3.7 The innodb_buffer_stats_by_schema and x$innodb_buffer_stats_by_schema Views"><code class="literal">innodb_buffer_stats_by_schema</code></a>,
              <a class="link" href="sys-schema.html#sys-innodb-buffer-stats-by-schema" title="26.4.3.7 The innodb_buffer_stats_by_schema and x$innodb_buffer_stats_by_schema Views"><code class="literal">x$innodb_buffer_stats_by_schema</code></a></td>
            <td align="left"><code class="literal">InnoDB</code> buffer information, grouped by schema</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-innodb-buffer-stats-by-table" title="26.4.3.8 The innodb_buffer_stats_by_table and x$innodb_buffer_stats_by_table Views"><code class="literal">innodb_buffer_stats_by_table</code></a>,
              <a class="link" href="sys-schema.html#sys-innodb-buffer-stats-by-table" title="26.4.3.8 The innodb_buffer_stats_by_table and x$innodb_buffer_stats_by_table Views"><code class="literal">x$innodb_buffer_stats_by_table</code></a></td>
            <td align="left"><code class="literal">InnoDB</code> buffer information, grouped by schema and
              table</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-innodb-lock-waits" title="26.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views"><code class="literal">innodb_lock_waits</code></a>,
              <a class="link" href="sys-schema.html#sys-innodb-lock-waits" title="26.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views"><code class="literal">x$innodb_lock_waits</code></a></td>
            <td align="left"><code class="literal">InnoDB</code> lock information</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-io-by-thread-by-latency" title="26.4.3.10 The io_by_thread_by_latency and x$io_by_thread_by_latency Views"><code class="literal">io_by_thread_by_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-io-by-thread-by-latency" title="26.4.3.10 The io_by_thread_by_latency and x$io_by_thread_by_latency Views"><code class="literal">x$io_by_thread_by_latency</code></a></td>
            <td align="left">I/O consumers, grouped by thread</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-io-global-by-file-by-bytes" title="26.4.3.11 The io_global_by_file_by_bytes and x$io_global_by_file_by_bytes Views"><code class="literal">io_global_by_file_by_bytes</code></a>,
              <a class="link" href="sys-schema.html#sys-io-global-by-file-by-bytes" title="26.4.3.11 The io_global_by_file_by_bytes and x$io_global_by_file_by_bytes Views"><code class="literal">x$io_global_by_file_by_bytes</code></a></td>
            <td align="left">Global I/O consumers, grouped by file and bytes</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-io-global-by-file-by-latency" title="26.4.3.12 The io_global_by_file_by_latency and x$io_global_by_file_by_latency Views"><code class="literal">io_global_by_file_by_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-io-global-by-file-by-latency" title="26.4.3.12 The io_global_by_file_by_latency and x$io_global_by_file_by_latency Views"><code class="literal">x$io_global_by_file_by_latency</code></a></td>
            <td align="left">Global I/O consumers, grouped by file and latency</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-io-global-by-wait-by-bytes" title="26.4.3.13 The io_global_by_wait_by_bytes and x$io_global_by_wait_by_bytes Views"><code class="literal">io_global_by_wait_by_bytes</code></a>,
              <a class="link" href="sys-schema.html#sys-io-global-by-wait-by-bytes" title="26.4.3.13 The io_global_by_wait_by_bytes and x$io_global_by_wait_by_bytes Views"><code class="literal">x$io_global_by_wait_by_bytes</code></a></td>
            <td align="left">Global I/O consumers, grouped by bytes</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-io-global-by-wait-by-latency" title="26.4.3.14 The io_global_by_wait_by_latency and x$io_global_by_wait_by_latency Views"><code class="literal">io_global_by_wait_by_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-io-global-by-wait-by-latency" title="26.4.3.14 The io_global_by_wait_by_latency and x$io_global_by_wait_by_latency Views"><code class="literal">x$io_global_by_wait_by_latency</code></a></td>
            <td align="left">Global I/O consumers, grouped by latency</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-latest-file-io" title="26.4.3.15 The latest_file_io and x$latest_file_io Views"><code class="literal">latest_file_io</code></a>,
              <a class="link" href="sys-schema.html#sys-latest-file-io" title="26.4.3.15 The latest_file_io and x$latest_file_io Views"><code class="literal">x$latest_file_io</code></a></td>
            <td align="left">Most recent I/O, grouped by file and thread</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-memory-by-host-by-current-bytes" title="26.4.3.16 The memory_by_host_by_current_bytes and x$memory_by_host_by_current_bytes Views"><code class="literal">memory_by_host_by_current_bytes</code></a>,
              <a class="link" href="sys-schema.html#sys-memory-by-host-by-current-bytes" title="26.4.3.16 The memory_by_host_by_current_bytes and x$memory_by_host_by_current_bytes Views"><code class="literal">x$memory_by_host_by_current_bytes</code></a></td>
            <td align="left">Memory use, grouped by host</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-memory-by-thread-by-current-bytes" title="26.4.3.17 The memory_by_thread_by_current_bytes and x$memory_by_thread_by_current_bytes Views"><code class="literal">memory_by_thread_by_current_bytes</code></a>,
              <a class="link" href="sys-schema.html#sys-memory-by-thread-by-current-bytes" title="26.4.3.17 The memory_by_thread_by_current_bytes and x$memory_by_thread_by_current_bytes Views"><code class="literal">x$memory_by_thread_by_current_bytes</code></a></td>
            <td align="left">Memory use, grouped by thread</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-memory-by-user-by-current-bytes" title="26.4.3.18 The memory_by_user_by_current_bytes and x$memory_by_user_by_current_bytes Views"><code class="literal">memory_by_user_by_current_bytes</code></a>,
              <a class="link" href="sys-schema.html#sys-memory-by-user-by-current-bytes" title="26.4.3.18 The memory_by_user_by_current_bytes and x$memory_by_user_by_current_bytes Views"><code class="literal">x$memory_by_user_by_current_bytes</code></a></td>
            <td align="left">Memory use, grouped by user</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-memory-global-by-current-bytes" title="26.4.3.19 The memory_global_by_current_bytes and x$memory_global_by_current_bytes Views"><code class="literal">memory_global_by_current_bytes</code></a>,
              <a class="link" href="sys-schema.html#sys-memory-global-by-current-bytes" title="26.4.3.19 The memory_global_by_current_bytes and x$memory_global_by_current_bytes Views"><code class="literal">x$memory_global_by_current_bytes</code></a></td>
            <td align="left">Memory use, grouped by allocation type</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-memory-global-total" title="26.4.3.20 The memory_global_total and x$memory_global_total Views"><code class="literal">memory_global_total</code></a>,
              <a class="link" href="sys-schema.html#sys-memory-global-total" title="26.4.3.20 The memory_global_total and x$memory_global_total Views"><code class="literal">x$memory_global_total</code></a></td>
            <td align="left">Total memory use</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View"><code class="literal">metrics</code></a></td>
            <td align="left">Server metrics</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-processlist" title="26.4.3.22 The processlist and x$processlist Views"><code class="literal">processlist</code></a>,
              <a class="link" href="sys-schema.html#sys-processlist" title="26.4.3.22 The processlist and x$processlist Views"><code class="literal">x$processlist</code></a></td>
            <td align="left">Processlist information</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-check-lost-instrumentation" title="26.4.3.23 The ps_check_lost_instrumentation View"><code class="literal">ps_check_lost_instrumentation</code></a></td>
            <td align="left">Variables that have lost instruments</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-auto-increment-columns" title="26.4.3.24 The schema_auto_increment_columns View"><code class="literal">schema_auto_increment_columns</code></a></td>
            <td align="left"><code class="literal">AUTO_INCREMENT</code> column information</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-index-statistics" title="26.4.3.25 The schema_index_statistics and x$schema_index_statistics Views"><code class="literal">schema_index_statistics</code></a>,
              <a class="link" href="sys-schema.html#sys-schema-index-statistics" title="26.4.3.25 The schema_index_statistics and x$schema_index_statistics Views"><code class="literal">x$schema_index_statistics</code></a></td>
            <td align="left">Index statistics</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-object-overview" title="26.4.3.26 The schema_object_overview View"><code class="literal">schema_object_overview</code></a></td>
            <td align="left">Types of objects within each schema</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-redundant-indexes" title="26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views"><code class="literal">schema_redundant_indexes</code></a></td>
            <td align="left">Duplicate or redundant indexes</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-table-lock-waits" title="26.4.3.28 The schema_table_lock_waits and x$schema_table_lock_waits Views"><code class="literal">schema_table_lock_waits</code></a>,
              <a class="link" href="sys-schema.html#sys-schema-table-lock-waits" title="26.4.3.28 The schema_table_lock_waits and x$schema_table_lock_waits Views"><code class="literal">x$schema_table_lock_waits</code></a></td>
            <td align="left">Sessions waiting for metadata locks</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-table-statistics" title="26.4.3.29 The schema_table_statistics and x$schema_table_statistics Views"><code class="literal">schema_table_statistics</code></a>,
              <a class="link" href="sys-schema.html#sys-schema-table-statistics" title="26.4.3.29 The schema_table_statistics and x$schema_table_statistics Views"><code class="literal">x$schema_table_statistics</code></a></td>
            <td align="left">Table statistics</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-table-statistics-with-buffer" title="26.4.3.30 The schema_table_statistics_with_buffer and x$schema_table_statistics_with_buffer Views"><code class="literal">schema_table_statistics_with_buffer</code></a>,
              <a class="link" href="sys-schema.html#sys-schema-table-statistics-with-buffer" title="26.4.3.30 The schema_table_statistics_with_buffer and x$schema_table_statistics_with_buffer Views"><code class="literal">x$schema_table_statistics_with_buffer</code></a></td>
            <td align="left">Table statistics, including <code class="literal">InnoDB</code> buffer pool
              statistics</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-tables-with-full-table-scans" title="26.4.3.31 The schema_tables_with_full_table_scans and x$schema_tables_with_full_table_scans Views"><code class="literal">schema_tables_with_full_table_scans</code></a>,
              <a class="link" href="sys-schema.html#sys-schema-tables-with-full-table-scans" title="26.4.3.31 The schema_tables_with_full_table_scans and x$schema_tables_with_full_table_scans Views"><code class="literal">x$schema_tables_with_full_table_scans</code></a></td>
            <td align="left">Tables being accessed with full scans</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-unused-indexes" title="26.4.3.32 The schema_unused_indexes View"><code class="literal">schema_unused_indexes</code></a></td>
            <td align="left">Indexes not in active use</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-session" title="26.4.3.33 The session and x$session Views"><code class="literal">session</code></a>,
              <a class="link" href="sys-schema.html#sys-session" title="26.4.3.33 The session and x$session Views"><code class="literal">x$session</code></a></td>
            <td align="left">Processlist information for user sessions</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-session-ssl-status" title="26.4.3.34 The session_ssl_status View"><code class="literal">session_ssl_status</code></a></td>
            <td align="left">Connection SSL information</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statement-analysis" title="26.4.3.35 The statement_analysis and x$statement_analysis Views"><code class="literal">statement_analysis</code></a>,
              <a class="link" href="sys-schema.html#sys-statement-analysis" title="26.4.3.35 The statement_analysis and x$statement_analysis Views"><code class="literal">x$statement_analysis</code></a></td>
            <td align="left">Statement aggregate statistics</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statements-with-errors-or-warnings" title="26.4.3.36 The statements_with_errors_or_warnings and x$statements_with_errors_or_warnings Views"><code class="literal">statements_with_errors_or_warnings</code></a>,
              <a class="link" href="sys-schema.html#sys-statements-with-errors-or-warnings" title="26.4.3.36 The statements_with_errors_or_warnings and x$statements_with_errors_or_warnings Views"><code class="literal">x$statements_with_errors_or_warnings</code></a></td>
            <td align="left">Statements that have produced errors or warnings</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statements-with-full-table-scans" title="26.4.3.37 The statements_with_full_table_scans and x$statements_with_full_table_scans Views"><code class="literal">statements_with_full_table_scans</code></a>,
              <a class="link" href="sys-schema.html#sys-statements-with-full-table-scans" title="26.4.3.37 The statements_with_full_table_scans and x$statements_with_full_table_scans Views"><code class="literal">x$statements_with_full_table_scans</code></a></td>
            <td align="left">Statements that have done full table scans</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile" title="26.4.3.38 The statements_with_runtimes_in_95th_percentile and x$statements_with_runtimes_in_95th_percentile Views"><code class="literal">statements_with_runtimes_in_95th_percentile</code></a>,
              <a class="link" href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile" title="26.4.3.38 The statements_with_runtimes_in_95th_percentile and x$statements_with_runtimes_in_95th_percentile Views"><code class="literal">x$statements_with_runtimes_in_95th_percentile</code></a></td>
            <td align="left">Statements with highest average runtime</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statements-with-sorting" title="26.4.3.39 The statements_with_sorting and x$statements_with_sorting Views"><code class="literal">statements_with_sorting</code></a>,
              <a class="link" href="sys-schema.html#sys-statements-with-sorting" title="26.4.3.39 The statements_with_sorting and x$statements_with_sorting Views"><code class="literal">x$statements_with_sorting</code></a></td>
            <td align="left">Statements that performed sorts</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statements-with-temp-tables" title="26.4.3.40 The statements_with_temp_tables and x$statements_with_temp_tables Views"><code class="literal">statements_with_temp_tables</code></a>,
              <a class="link" href="sys-schema.html#sys-statements-with-temp-tables" title="26.4.3.40 The statements_with_temp_tables and x$statements_with_temp_tables Views"><code class="literal">x$statements_with_temp_tables</code></a></td>
            <td align="left">Statements that used temporary tables</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-user-summary" title="26.4.3.41 The user_summary and x$user_summary Views"><code class="literal">user_summary</code></a>,
              <a class="link" href="sys-schema.html#sys-user-summary" title="26.4.3.41 The user_summary and x$user_summary Views"><code class="literal">x$user_summary</code></a></td>
            <td align="left">User statement and connection activity</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-user-summary-by-file-io" title="26.4.3.42 The user_summary_by_file_io and x$user_summary_by_file_io Views"><code class="literal">user_summary_by_file_io</code></a>,
              <a class="link" href="sys-schema.html#sys-user-summary-by-file-io" title="26.4.3.42 The user_summary_by_file_io and x$user_summary_by_file_io Views"><code class="literal">x$user_summary_by_file_io</code></a></td>
            <td align="left">File I/O, grouped by user</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-user-summary-by-file-io-type" title="26.4.3.43 The user_summary_by_file_io_type and x$user_summary_by_file_io_type Views"><code class="literal">user_summary_by_file_io_type</code></a>,
              <a class="link" href="sys-schema.html#sys-user-summary-by-file-io-type" title="26.4.3.43 The user_summary_by_file_io_type and x$user_summary_by_file_io_type Views"><code class="literal">x$user_summary_by_file_io_type</code></a></td>
            <td align="left">File I/O, grouped by user and event</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-user-summary-by-stages" title="26.4.3.44 The user_summary_by_stages and x$user_summary_by_stages Views"><code class="literal">user_summary_by_stages</code></a>,
              <a class="link" href="sys-schema.html#sys-user-summary-by-stages" title="26.4.3.44 The user_summary_by_stages and x$user_summary_by_stages Views"><code class="literal">x$user_summary_by_stages</code></a></td>
            <td align="left">Stage events, grouped by user</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-user-summary-by-statement-latency" title="26.4.3.45 The user_summary_by_statement_latency and x$user_summary_by_statement_latency Views"><code class="literal">user_summary_by_statement_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-user-summary-by-statement-latency" title="26.4.3.45 The user_summary_by_statement_latency and x$user_summary_by_statement_latency Views"><code class="literal">x$user_summary_by_statement_latency</code></a></td>
            <td align="left">Statement statistics, grouped by user</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-user-summary-by-statement-type" title="26.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type Views"><code class="literal">user_summary_by_statement_type</code></a>,
              <a class="link" href="sys-schema.html#sys-user-summary-by-statement-type" title="26.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type Views"><code class="literal">x$user_summary_by_statement_type</code></a></td>
            <td align="left">Statements executed, grouped by user and statement</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-version" title="26.4.3.47 The version View"><code class="literal">version</code></a></td>
            <td align="left">Current <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema and MySQL server
              versions</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-wait-classes-global-by-avg-latency" title="26.4.3.48 The wait_classes_global_by_avg_latency and x$wait_classes_global_by_avg_latency Views"><code class="literal">wait_classes_global_by_avg_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-wait-classes-global-by-avg-latency" title="26.4.3.48 The wait_classes_global_by_avg_latency and x$wait_classes_global_by_avg_latency Views"><code class="literal">x$wait_classes_global_by_avg_latency</code></a></td>
            <td align="left">Wait class average latency, grouped by event class</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-wait-classes-global-by-latency" title="26.4.3.49 The wait_classes_global_by_latency and x$wait_classes_global_by_latency Views"><code class="literal">wait_classes_global_by_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-wait-classes-global-by-latency" title="26.4.3.49 The wait_classes_global_by_latency and x$wait_classes_global_by_latency Views"><code class="literal">x$wait_classes_global_by_latency</code></a></td>
            <td align="left">Wait class total latency, grouped by event class</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-waits-by-host-by-latency" title="26.4.3.50 The waits_by_host_by_latency and x$waits_by_host_by_latency Views"><code class="literal">waits_by_host_by_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-waits-by-host-by-latency" title="26.4.3.50 The waits_by_host_by_latency and x$waits_by_host_by_latency Views"><code class="literal">x$waits_by_host_by_latency</code></a></td>
            <td align="left">Wait events, grouped by host and event</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-waits-by-user-by-latency" title="26.4.3.51 The waits_by_user_by_latency and x$waits_by_user_by_latency Views"><code class="literal">waits_by_user_by_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-waits-by-user-by-latency" title="26.4.3.51 The waits_by_user_by_latency and x$waits_by_user_by_latency Views"><code class="literal">x$waits_by_user_by_latency</code></a></td>
            <td align="left">Wait events, grouped by user and event</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-waits-global-by-latency" title="26.4.3.52 The waits_global_by_latency and x$waits_global_by_latency Views"><code class="literal">waits_global_by_latency</code></a>,
              <a class="link" href="sys-schema.html#sys-waits-global-by-latency" title="26.4.3.52 The waits_global_by_latency and x$waits_global_by_latency Views"><code class="literal">x$waits_global_by_latency</code></a></td>
            <td align="left">Wait events, grouped by event</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile" title="26.4.3.38 The statements_with_runtimes_in_95th_percentile and x$statements_with_runtimes_in_95th_percentile Views"><code class="literal">x$ps_digest_95th_percentile_by_avg_us</code></a></td>
            <td align="left">Helper view for 95th-percentile views</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile" title="26.4.3.38 The statements_with_runtimes_in_95th_percentile and x$statements_with_runtimes_in_95th_percentile Views"><code class="literal">x$ps_digest_avg_latency_distribution</code></a></td>
            <td align="left">Helper view for 95th-percentile views</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-table-statistics" title="26.4.3.29 The schema_table_statistics and x$schema_table_statistics Views"><code class="literal">x$ps_schema_table_statistics_io</code></a></td>
            <td align="left">Helper view for table-statistics views</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-schema-redundant-indexes" title="26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views"><code class="literal">x$schema_flattened_keys</code></a></td>
            <td align="left">Helper view for <a class="link" href="sys-schema.html#sys-schema-redundant-indexes" title="26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views"><code class="literal">schema_redundant_indexes</code></a></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="table">
<a name="sys-schema-procedures-table"></a><p class="title"><b>Table 26.3 sys Schema Stored Procedures</b></p>
<div class="table-contents">
<table summary="Stored procedures used in the sys schema implementation"><col width="60%"><col width="40%"><thead><tr>
            <th align="center" scope="col">Procedure Name</th>
            <th align="center" scope="col">Description</th>
          </tr></thead><tbody><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-create-synonym-db" title="26.4.4.1 The create_synonym_db() Procedure"><code class="literal">create_synonym_db()</code></a></td>
            <td align="left">Create synonym for schema</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a></td>
            <td align="left">Collect system diagnostic information</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-execute-prepared-stmt" title="26.4.4.3 The execute_prepared_stmt() Procedure"><code class="literal">execute_prepared_stmt()</code></a></td>
            <td align="left">Execute prepared statement</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-disable-background-threads" title="26.4.4.4 The ps_setup_disable_background_threads() Procedure"><code class="literal">ps_setup_disable_background_threads()</code></a></td>
            <td align="left">Disable background thread instrumentation</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-disable-consumer" title="26.4.4.5 The ps_setup_disable_consumer() Procedure"><code class="literal">ps_setup_disable_consumer()</code></a></td>
            <td align="left">Disable consumers</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-disable-instrument" title="26.4.4.6 The ps_setup_disable_instrument() Procedure"><code class="literal">ps_setup_disable_instrument()</code></a></td>
            <td align="left">Disable instruments</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-disable-thread" title="26.4.4.7 The ps_setup_disable_thread() Procedure"><code class="literal">ps_setup_disable_thread()</code></a></td>
            <td align="left">Disable instrumentation for thread</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-enable-background-threads" title="26.4.4.8 The ps_setup_enable_background_threads() Procedure"><code class="literal">ps_setup_enable_background_threads()</code></a></td>
            <td align="left">Enable background thread instrumentation</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-enable-consumer" title="26.4.4.9 The ps_setup_enable_consumer() Procedure"><code class="literal">ps_setup_enable_consumer()</code></a></td>
            <td align="left">Enable consumers</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-enable-instrument" title="26.4.4.10 The ps_setup_enable_instrument() Procedure"><code class="literal">ps_setup_enable_instrument()</code></a></td>
            <td align="left">Enable instruments</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-enable-thread" title="26.4.4.11 The ps_setup_enable_thread() Procedure"><code class="literal">ps_setup_enable_thread()</code></a></td>
            <td align="left">Enable instrumentation for thread</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-reload-saved" title="26.4.4.12 The ps_setup_reload_saved() Procedure"><code class="literal">ps_setup_reload_saved()</code></a></td>
            <td align="left">Reload saved Performance Schema configuration</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-reset-to-default" title="26.4.4.13 The ps_setup_reset_to_default() Procedure"><code class="literal">ps_setup_reset_to_default()</code></a></td>
            <td align="left">Reset saved Performance Schema configuration</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a></td>
            <td align="left">Save Performance Schema configuration</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-show-disabled" title="26.4.4.15 The ps_setup_show_disabled() Procedure"><code class="literal">ps_setup_show_disabled()</code></a></td>
            <td align="left">Display disabled Performance Schema configuration</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-show-disabled-consumers" title="26.4.4.16 The ps_setup_show_disabled_consumers() Procedure"><code class="literal">ps_setup_show_disabled_consumers()</code></a></td>
            <td align="left">Display disabled Performance Schema consumers</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-show-disabled-instruments" title="26.4.4.17 The ps_setup_show_disabled_instruments() Procedure"><code class="literal">ps_setup_show_disabled_instruments()</code></a></td>
            <td align="left">Display disabled Performance Schema instruments</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-show-enabled" title="26.4.4.18 The ps_setup_show_enabled() Procedure"><code class="literal">ps_setup_show_enabled()</code></a></td>
            <td align="left">Display enabled Performance Schema configuration</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-show-enabled-consumers" title="26.4.4.19 The ps_setup_show_enabled_consumers() Procedure"><code class="literal">ps_setup_show_enabled_consumers()</code></a></td>
            <td align="left">Display enabled Performance Schema consumers</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-setup-show-enabled-instruments" title="26.4.4.20 The ps_setup_show_enabled_instruments() Procedure"><code class="literal">ps_setup_show_enabled_instruments()</code></a></td>
            <td align="left">Display enabled Performance Schema instruments</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-statement-avg-latency-histogram" title="26.4.4.21 The ps_statement_avg_latency_histogram() Procedure"><code class="literal">ps_statement_avg_latency_histogram()</code></a></td>
            <td align="left">Display statement latency histogram</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-trace-statement-digest" title="26.4.4.22 The ps_trace_statement_digest() Procedure"><code class="literal">ps_trace_statement_digest()</code></a></td>
            <td align="left">Trace Performance Schema instrumentation for digest</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-trace-thread" title="26.4.4.23 The ps_trace_thread() Procedure"><code class="literal">ps_trace_thread()</code></a></td>
            <td align="left">Dump Performance Schema data for thread</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-truncate-all-tables" title="26.4.4.24 The ps_truncate_all_tables() Procedure"><code class="literal">ps_truncate_all_tables()</code></a></td>
            <td align="left">Truncate Performance Schema summary tables</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-statement-performance-analyzer" title="26.4.4.25 The statement_performance_analyzer() Procedure"><code class="literal">statement_performance_analyzer()</code></a></td>
            <td align="left">Report of statements running on server</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-table-exists" title="26.4.4.26 The table_exists() Procedure"><code class="literal">table_exists()</code></a></td>
            <td align="left">Whether a table exists</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="table">
<a name="sys-schema-functions-table"></a><p class="title"><b>Table 26.4 sys Schema Stored Functions</b></p>
<div class="table-contents">
<table summary="Stored functions used in the sys schema implementation"><col width="60%"><col width="40%"><thead><tr>
            <th align="center" scope="col">Function Name</th>
            <th align="center" scope="col">Description</th>
          </tr></thead><tbody><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-extract-schema-from-file-name" title="26.4.5.1 The extract_schema_from_file_name() Function"><code class="literal">extract_schema_from_file_name()</code></a></td>
            <td align="left">Extract schema name from file path name</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-extract-table-from-file-name" title="26.4.5.2 The extract_table_from_file_name() Function"><code class="literal">extract_table_from_file_name()</code></a></td>
            <td align="left">Extract table name from file path name</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-format-bytes" title="26.4.5.3 The format_bytes() Function"><code class="literal">format_bytes()</code></a></td>
            <td align="left">Convert byte value to value with units</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-format-path" title="26.4.5.4 The format_path() Function"><code class="literal">format_path()</code></a></td>
            <td align="left">Replace data and temp-file directories in path name with symbolic values</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a></td>
            <td align="left">Truncate long statement to fixed length</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-format-time" title="26.4.5.6 The format_time() Function"><code class="literal">format_time()</code></a></td>
            <td align="left">Convert picoseconds value to value with units</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-list-add" title="26.4.5.7 The list_add() Function"><code class="literal">list_add()</code></a></td>
            <td align="left">Add item to list</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-list-drop" title="26.4.5.8 The list_drop() Function"><code class="literal">list_drop()</code></a></td>
            <td align="left">Remove item from list</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-is-account-enabled" title="26.4.5.9 The ps_is_account_enabled() Function"><code class="literal">ps_is_account_enabled()</code></a></td>
            <td align="left">Check whether account instrumentation is enabled</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-is-consumer-enabled" title="26.4.5.10 The ps_is_consumer_enabled() Function"><code class="literal">ps_is_consumer_enabled()</code></a></td>
            <td align="left">Check whether consumer is enabled</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-is-instrument-default-enabled" title="26.4.5.11 The ps_is_instrument_default_enabled() Function"><code class="literal">ps_is_instrument_default_enabled()</code></a></td>
            <td align="left">Check whether instrument is enabled</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-is-instrument-default-timed" title="26.4.5.12 The ps_is_instrument_default_timed() Function"><code class="literal">ps_is_instrument_default_timed()</code></a></td>
            <td align="left">Check whether instrument is timed</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-is-thread-instrumented" title="26.4.5.13 The ps_is_thread_instrumented() Function"><code class="literal">ps_is_thread_instrumented()</code></a></td>
            <td align="left">Check whether thread is instrumented</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-thread-account" title="26.4.5.14 The ps_thread_account() Function"><code class="literal">ps_thread_account()</code></a></td>
            <td align="left">Return account for thread ID</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-thread-id" title="26.4.5.15 The ps_thread_id() Function"><code class="literal">ps_thread_id()</code></a></td>
            <td align="left">Return thread ID for connection ID</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-thread-stack" title="26.4.5.16 The ps_thread_stack() Function"><code class="literal">ps_thread_stack()</code></a></td>
            <td align="left">Return event information for thread ID</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-ps-thread-trx-info" title="26.4.5.17 The ps_thread_trx_info() Function"><code class="literal">ps_thread_trx_info()</code></a></td>
            <td align="left">Return transaction information for thread ID</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-quote-identifier" title="26.4.5.18 The quote_identifier() Function"><code class="literal">quote_identifier()</code></a></td>
            <td align="left">Return string as quoted identifier</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-sys-get-config" title="26.4.5.19 The sys_get_config() Function"><code class="literal">sys_get_config()</code></a></td>
            <td align="left">Return <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema configuration option</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-version-major" title="26.4.5.20 The version_major() Function"><code class="literal">version_major()</code></a></td>
            <td align="left">MySQL server major version number</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-version-minor" title="26.4.5.21 The version_minor() Function"><code class="literal">version_minor()</code></a></td>
            <td align="left">MySQL server minor version number</td>
          </tr><tr>
            <td align="left" scope="row"><a class="link" href="sys-schema.html#sys-version-patch" title="26.4.5.22 The version_patch() Function"><code class="literal">version_patch()</code></a></td>
            <td align="left">MySQL server patch release version number</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="sys-schema-tables"></a>26.4.2 sys Schema Tables and Triggers</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="sys-schema.html#sys-sys-config">26.4.2.1 The sys_config Table</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-sys-config-insert-set-user">26.4.2.2 The sys_config_insert_set_user Trigger</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-sys-config-update-set-user">26.4.2.3 The sys_config_update_set_user Trigger</a></span></dt></dl>
</div>
<p>
        The following sections describe
        <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema tables and triggers.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-sys-config"></a>26.4.2.1 The sys_config Table</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465683632"></a><a class="indexterm" name="idm139899465682144"></a><p>
          This table contains <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema
          configuration options, one row per option. Configuration
          changes made by updating this table persist across client
          sessions and server restarts.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table has these
          columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">variable</code>
            </p><p>
              The configuration option name.
            </p></li><li class="listitem"><p>
              <code class="literal">value</code>
            </p><p>
              The configuration option value.
            </p></li><li class="listitem"><p>
              <code class="literal">set_time</code>
            </p><p>
              The timestamp of the most recent modification to the row.
            </p></li><li class="listitem"><p>
              <code class="literal">set_by</code>
            </p><p>
              The account that made the most recent modification to the
              row. The value is <code class="literal">NULL</code> if the row has
              not been changed since the
              <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema was installed.
</p></li></ul>
</div>
<p>
          As an efficiency measure to minimize the number of direct
          reads from the <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table,
          <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema functions that use a
          value from this table check for a user-defined variable with a
          corresponding name, which is the user-defined variable having
          the same name plus a <code class="literal">@sys.</code> prefix. (For
          example, the variable corresponding to the
          <code class="literal">diagnostics.include_raw</code> option is
          <code class="literal">@sys.diagnostics.include_raw</code>.) If the
          user-defined variable exists in the current session and is
          non-<code class="literal">NULL</code>, the function uses its value in
          preference to the value in the
          <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table. Otherwise, the
          function reads and uses the value from the table. In the
          latter case, the calling function conventionally also sets the
          corresponding user-defined variable to the table value so that
          further references to the configuration option within the same
          session use the variable and need not read the table again.
        </p><p>
          For example, the <code class="literal">statement_truncate_len</code>
          option controls the maximum length of statements returned by
          the <a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a> function.
          The default is 64. To temporarily change the value to 32 for
          your current session, set the corresponding
          <code class="literal">@sys.statement_truncate_len</code> user-defined
          variable:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SET @stmt = 'SELECT variable, value, set_time, set_by FROM sys_config';</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT format_statement(@stmt);</code></strong>
+----------------------------------------------------------+
| format_statement(@stmt)                                  |
+----------------------------------------------------------+
| SELECT variable, value, set_time, set_by FROM sys_config |
+----------------------------------------------------------+
mysql&gt; <strong class="userinput"><code>SET @sys.statement_truncate_len = 32;</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT format_statement(@stmt);</code></strong>
+-----------------------------------+
| format_statement(@stmt)           |
+-----------------------------------+
| SELECT variabl ... ROM sys_config |
+-----------------------------------+
</pre><p>
          Subsequent invocations of
          <a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a> within the
          session continue to use the user-defined variable value (32),
          rather than the value stored in the table (64).
        </p><p>
          To stop using the user-defined variable and revert to using
          the value in the table, set the variable to
          <code class="literal">NULL</code> within your session:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SET @sys.statement_truncate_len = NULL;</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT format_statement(@stmt);</code></strong>
+----------------------------------------------------------+
| format_statement(@stmt)                                  |
+----------------------------------------------------------+
| SELECT variable, value, set_time, set_by FROM sys_config |
+----------------------------------------------------------+
</pre><p>
          Alternatively, end your current session (causing the
          user-defined variable to no longer exist) and begin a new
          session.
        </p><p>
          The conventional relationship just described between options
          in the <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table and
          user-defined variables can be exploited to make temporary
          configuration changes that end when your session ends.
          However, if you set a user-defined variable and then
          subsequently change the corresponding table value within the
          same session, the changed table value will not be used in that
          session as long as the user-defined variable exists with a
          non-<code class="literal">NULL</code> value. (The changed table value
          <span class="emphasis"><em>will</em></span> be used in other sessions that do
          not have the user-defined variable assigned.)
        </p><p>
          The following list describes the options in the
          <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table and the
          corresponding user-defined variables:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">diagnostics.allow_i_s_tables</code>,
              <code class="literal">@sys.diagnostics.allow_i_s_tables</code>
            </p><p>
              If this option is <code class="literal">ON</code>, the
              <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a> procedure is
              permitted to perform table scans on the
              <a class="link" href="information-schema.html#tables-table" title="24.26 The INFORMATION_SCHEMA TABLES Table"><code class="literal">INFORMATION_SCHEMA.TABLES</code></a>
              table. This can be expensive if there are many tables. The
              default is <code class="literal">OFF</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">diagnostics.include_raw</code>,
              <code class="literal">@sys.diagnostics.include_raw</code>
            </p><p>
              If this option is <code class="literal">ON</code>, the
              <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a> procedure
              includes the raw output from querying the
              <a class="link" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View"><code class="literal">metrics</code></a> view. The default is
              <code class="literal">OFF</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">ps_thread_trx_info.max_length</code>,
              <code class="literal">@sys.ps_thread_trx_info.max_length</code>
            </p><p>
              The maximum length for JSON output produced by the
              <a class="link" href="sys-schema.html#sys-ps-thread-trx-info" title="26.4.5.17 The ps_thread_trx_info() Function"><code class="literal">ps_thread_trx_info()</code></a>
              function. The default is 65535.
            </p></li><li class="listitem"><p>
              <code class="literal">statement_performance_analyzer.limit</code>,
              <code class="literal">@sys.statement_performance_analyzer.limit</code>
            </p><p>
              The maximum number of rows to return for views that have
              no built-in limit. (For example, the
              <a class="link" href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile" title="26.4.3.38 The statements_with_runtimes_in_95th_percentile and x$statements_with_runtimes_in_95th_percentile Views"><code class="literal">statements_with_runtimes_in_95th_percentile</code></a>
              view has a built-in limit in the sense that it returns
              only statements with average execution time in the 95th
              percentile.) The default is 100.
            </p></li><li class="listitem"><p>
              <code class="literal">statement_performance_analyzer.view</code>,
              <code class="literal">@sys.statement_performance_analyzer.view</code>
            </p><p>
              The custom query or view to be used by the
              <a class="link" href="sys-schema.html#sys-statement-performance-analyzer" title="26.4.4.25 The statement_performance_analyzer() Procedure"><code class="literal">statement_performance_analyzer()</code></a>
              procedure (which is itself invoked by the
              <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a> procedure). If
              the option value contains a space, it is interpreted as a
              query. Otherwise, it must be the name of an existing view
              that queries the Performance Schema
              <a class="link" href="performance-schema.html#statement-summary-tables" title="25.11.15.3 Statement Summary Tables"><code class="literal">events_statements_summary_by_digest</code></a>
              table. There cannot be any <code class="literal">LIMIT</code> clause
              in the query or view definition if the
              <code class="literal">statement_performance_analyzer.limit</code>
              configuration option is greater than 0. The default is
              <code class="literal">NULL</code> (no custom view defined).
            </p></li><li class="listitem"><p>
              <code class="literal">statement_truncate_len</code>,
              <code class="literal">@sys.statement_truncate_len</code>
            </p><p>
              The maximum length of statements returned by the
              <a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a> function.
              Longer statements are truncated to this length. The
              default is 64.
</p></li></ul>
</div>
<p>
          Other options can be added to the
          <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table. For example,
          the <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a> and
          <a class="link" href="sys-schema.html#sys-execute-prepared-stmt" title="26.4.4.3 The execute_prepared_stmt() Procedure"><code class="literal">execute_prepared_stmt()</code></a>
          procedures use the <code class="literal">debug</code> option if it
          exists, but this option is not part of the
          <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table by default
          because debug output normally is enabled only temporarily, by
          setting the corresponding <code class="literal">@sys.debug</code>
          user-defined variable. To enable debug output without having
          to set that variable in individual sessions, add the option to
          the table:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>INSERT INTO sys_config (variable, value) VALUES('debug', 'ON');</code></strong>
</pre><p>
          To change the debug setting in the table, do two things.
          First, modify the value in the table itself:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>UPDATE sys_config SET value = 'OFF' WHERE variable = 'debug';</code></strong>
</pre><p>
          Second, to also ensure that procedure invocations within the
          current session use the changed value from the table, set the
          corresponding user-defined variable to
          <code class="literal">NULL</code>:
        </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SET @sys.debug = NULL;</code></strong>
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-sys-config-insert-set-user"></a>26.4.2.2 The sys_config_insert_set_user Trigger</h4>

</div>

</div>

</div>
<p>
          For rows added to the <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a>
          table by <code class="literal">INSERT</code> statements, the
          <a class="link" href="sys-schema.html#sys-sys-config-insert-set-user" title="26.4.2.2 The sys_config_insert_set_user Trigger"><code class="literal">sys_config_insert_set_user</code></a>
          trigger sets the <code class="literal">set_by</code> column to the
          current user.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-sys-config-update-set-user"></a>26.4.2.3 The sys_config_update_set_user Trigger</h4>

</div>

</div>

</div>
<p>
          The <a class="link" href="sys-schema.html#sys-sys-config-update-set-user" title="26.4.2.3 The sys_config_update_set_user Trigger"><code class="literal">sys_config_update_set_user</code></a>
          trigger for the <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table
          is similar to the
          <a class="link" href="sys-schema.html#sys-sys-config-insert-set-user" title="26.4.2.2 The sys_config_insert_set_user Trigger"><code class="literal">sys_config_insert_set_user</code></a>
          trigger, but for <a class="link" href="sql-syntax.html#update" title="13.2.12 UPDATE Syntax"><code class="literal">UPDATE</code></a>
          statements.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="sys-schema-views"></a>26.4.3 sys Schema Views</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="sys-schema.html#sys-host-summary">26.4.3.1 The host_summary and x$host_summary Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-host-summary-by-file-io">26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-host-summary-by-file-io-type">26.4.3.3 The host_summary_by_file_io_type and x$host_summary_by_file_io_type
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-host-summary-by-stages">26.4.3.4 The host_summary_by_stages and x$host_summary_by_stages Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-host-summary-by-statement-latency">26.4.3.5 The host_summary_by_statement_latency and
          x$host_summary_by_statement_latency Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-host-summary-by-statement-type">26.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-innodb-buffer-stats-by-schema">26.4.3.7 The innodb_buffer_stats_by_schema and x$innodb_buffer_stats_by_schema
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-innodb-buffer-stats-by-table">26.4.3.8 The innodb_buffer_stats_by_table and x$innodb_buffer_stats_by_table
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-innodb-lock-waits">26.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-io-by-thread-by-latency">26.4.3.10 The io_by_thread_by_latency and x$io_by_thread_by_latency Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-io-global-by-file-by-bytes">26.4.3.11 The io_global_by_file_by_bytes and x$io_global_by_file_by_bytes Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-io-global-by-file-by-latency">26.4.3.12 The io_global_by_file_by_latency and x$io_global_by_file_by_latency
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-io-global-by-wait-by-bytes">26.4.3.13 The io_global_by_wait_by_bytes and x$io_global_by_wait_by_bytes Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-io-global-by-wait-by-latency">26.4.3.14 The io_global_by_wait_by_latency and x$io_global_by_wait_by_latency
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-latest-file-io">26.4.3.15 The latest_file_io and x$latest_file_io Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-memory-by-host-by-current-bytes">26.4.3.16 The memory_by_host_by_current_bytes and
          x$memory_by_host_by_current_bytes Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-memory-by-thread-by-current-bytes">26.4.3.17 The memory_by_thread_by_current_bytes and
          x$memory_by_thread_by_current_bytes Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-memory-by-user-by-current-bytes">26.4.3.18 The memory_by_user_by_current_bytes and
          x$memory_by_user_by_current_bytes Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-memory-global-by-current-bytes">26.4.3.19 The memory_global_by_current_bytes and x$memory_global_by_current_bytes
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-memory-global-total">26.4.3.20 The memory_global_total and x$memory_global_total Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-metrics">26.4.3.21 The metrics View</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-processlist">26.4.3.22 The processlist and x$processlist Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-check-lost-instrumentation">26.4.3.23 The ps_check_lost_instrumentation View</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-auto-increment-columns">26.4.3.24 The schema_auto_increment_columns View</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-index-statistics">26.4.3.25 The schema_index_statistics and x$schema_index_statistics Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-object-overview">26.4.3.26 The schema_object_overview View</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-redundant-indexes">26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-table-lock-waits">26.4.3.28 The schema_table_lock_waits and x$schema_table_lock_waits Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-table-statistics">26.4.3.29 The schema_table_statistics and x$schema_table_statistics Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-table-statistics-with-buffer">26.4.3.30 The schema_table_statistics_with_buffer and
          x$schema_table_statistics_with_buffer Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-tables-with-full-table-scans">26.4.3.31 The schema_tables_with_full_table_scans and
          x$schema_tables_with_full_table_scans Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-schema-unused-indexes">26.4.3.32 The schema_unused_indexes View</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-session">26.4.3.33 The session and x$session Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-session-ssl-status">26.4.3.34 The session_ssl_status View</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-statement-analysis">26.4.3.35 The statement_analysis and x$statement_analysis Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-statements-with-errors-or-warnings">26.4.3.36 The statements_with_errors_or_warnings and
          x$statements_with_errors_or_warnings Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-statements-with-full-table-scans">26.4.3.37 The statements_with_full_table_scans and
          x$statements_with_full_table_scans Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile">26.4.3.38 The statements_with_runtimes_in_95th_percentile and
          x$statements_with_runtimes_in_95th_percentile Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-statements-with-sorting">26.4.3.39 The statements_with_sorting and x$statements_with_sorting Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-statements-with-temp-tables">26.4.3.40 The statements_with_temp_tables and x$statements_with_temp_tables Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-user-summary">26.4.3.41 The user_summary and x$user_summary Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-user-summary-by-file-io">26.4.3.42 The user_summary_by_file_io and x$user_summary_by_file_io Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-user-summary-by-file-io-type">26.4.3.43 The user_summary_by_file_io_type and x$user_summary_by_file_io_type
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-user-summary-by-stages">26.4.3.44 The user_summary_by_stages and x$user_summary_by_stages Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-user-summary-by-statement-latency">26.4.3.45 The user_summary_by_statement_latency and
          x$user_summary_by_statement_latency Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-user-summary-by-statement-type">26.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type
          Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-version">26.4.3.47 The version View</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-wait-classes-global-by-avg-latency">26.4.3.48 The wait_classes_global_by_avg_latency and
          x$wait_classes_global_by_avg_latency Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-wait-classes-global-by-latency">26.4.3.49 The wait_classes_global_by_latency and x$wait_classes_global_by_latency
Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-waits-by-host-by-latency">26.4.3.50 The waits_by_host_by_latency and x$waits_by_host_by_latency Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-waits-by-user-by-latency">26.4.3.51 The waits_by_user_by_latency and x$waits_by_user_by_latency Views</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-waits-global-by-latency">26.4.3.52 The waits_global_by_latency and x$waits_global_by_latency Views</a></span></dt></dl>
</div>
<p>
        The following sections describe
        <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema views.
      </p><a class="indexterm" name="idm139899465573680"></a><a class="indexterm" name="idm139899465572192"></a><p>
        The <code class="literal">sys</code> schema contains many views that
        summarize Performance Schema tables in various ways. Most of
        these views come in pairs, such that one member of the pair has
        the same name as the other member, plus a <code class="literal">x$</code>
        prefix. For example, the
        <a class="link" href="sys-schema.html#sys-host-summary-by-file-io" title="26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views"><code class="literal">host_summary_by_file_io</code></a> view
        summarizes file I/O grouped by host and displays latencies
        converted from picoseconds to more readable values (with units);
      </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM host_summary_by_file_io;</code></strong>
+------------+-------+------------+
| host       | ios   | io_latency |
+------------+-------+------------+
| localhost  | 67570 | 5.38 s     |
| background |  3468 | 4.18 s     |
+------------+-------+------------+
</pre><p>
        The <a class="link" href="sys-schema.html#sys-host-summary-by-file-io" title="26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views"><code class="literal">x$host_summary_by_file_io</code></a> view
        summarizes the same data but displays unformatted picosecond
        latencies:
      </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT * FROM x$host_summary_by_file_io;</code></strong>
+------------+-------+---------------+
| host       | ios   | io_latency    |
+------------+-------+---------------+
| localhost  | 67574 | 5380678125144 |
| background |  3474 | 4758696829416 |
+------------+-------+---------------+
</pre><p>
        The view without the <code class="literal">x$</code> prefix is intended to
        provide output that is more user friendly and easier to read.
        The view with the <code class="literal">x$</code> prefix that displays the
        same values in raw form is intended more for use with other
        tools that perform their own processing on the data.
      </p><p>
        Views without the <code class="literal">x$</code> prefix differ from the
        corresponding <code class="literal">x$</code> views in these ways:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Byte values are formatted with size units using
            <a class="link" href="sys-schema.html#sys-format-bytes" title="26.4.5.3 The format_bytes() Function"><code class="literal">format_bytes()</code></a>.
          </p></li><li class="listitem"><p>
            Time values are formatted with temporal units using
            <a class="link" href="sys-schema.html#sys-format-time" title="26.4.5.6 The format_time() Function"><code class="literal">format_time()</code></a>.
          </p></li><li class="listitem"><p>
            SQL statements are truncated to a maximum display width
            using <a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a>.
          </p></li><li class="listitem"><p>
            Path name are shortened using
            <a class="link" href="sys-schema.html#sys-format-path" title="26.4.5.4 The format_path() Function"><code class="literal">format_path()</code></a>.
</p></li></ul>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-host-summary"></a>26.4.3.1 The host_summary and x$host_summary Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899465547904"></a><a class="indexterm" name="idm139899465546448"></a><a class="indexterm" name="idm139899465544960"></a><a class="indexterm" name="idm139899465543472"></a><p>
          These views summarize statement activity, file I/O, and
          connections, grouped by host.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-host-summary" title="26.4.3.1 The host_summary and x$host_summary Views"><code class="literal">host_summary</code></a> and
          <a class="link" href="sys-schema.html#sys-host-summary" title="26.4.3.1 The host_summary and x$host_summary Views"><code class="literal">x$host_summary</code></a> views have these
          columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">host</code>
            </p><p>
              The host from which the client connected. Rows for which
              the <code class="literal">HOST</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">statements</code>
            </p><p>
              The total number of statements for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">statement_latency</code>
            </p><p>
              The total wait time of timed statements for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">statement_avg_latency</code>
            </p><p>
              The average wait time per timed statement for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">table_scans</code>
            </p><p>
              The total number of table scans for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">file_ios</code>
            </p><p>
              The total number of file I/O events for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">file_io_latency</code>
            </p><p>
              The total wait time of timed file I/O events for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">current_connections</code>
            </p><p>
              The current number of connections for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">total_connections</code>
            </p><p>
              The total number of connections for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">unique_users</code>
            </p><p>
              The number of distinct users for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">current_memory</code>
            </p><p>
              The current amount of allocated memory for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">total_memory_allocated</code>
            </p><p>
              The total amount of allocated memory for the host.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-host-summary-by-file-io"></a>26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899465511280"></a><a class="indexterm" name="idm139899465509824"></a><a class="indexterm" name="idm139899465508320"></a><a class="indexterm" name="idm139899465506816"></a><p>
          These views summarize file I/O, grouped by host. By default,
          rows are sorted by descending total file I/O latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-host-summary-by-file-io" title="26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views"><code class="literal">host_summary_by_file_io</code></a> and
          <a class="link" href="sys-schema.html#sys-host-summary-by-file-io" title="26.4.3.2 The host_summary_by_file_io and x$host_summary_by_file_io Views"><code class="literal">x$host_summary_by_file_io</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">host</code>
            </p><p>
              The host from which the client connected. Rows for which
              the <code class="literal">HOST</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">ios</code>
            </p><p>
              The total number of file I/O events for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">io_latency</code>
            </p><p>
              The total wait time of timed file I/O events for the host.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-host-summary-by-file-io-type"></a>26.4.3.3 The host_summary_by_file_io_type and x$host_summary_by_file_io_type
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465491872"></a><a class="indexterm" name="idm139899465490416"></a><a class="indexterm" name="idm139899465488912"></a><a class="indexterm" name="idm139899465487408"></a><p>
          These views summarize file I/O, grouped by host and event
          type. By default, rows are sorted by host and descending total
          I/O latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-host-summary-by-file-io-type" title="26.4.3.3 The host_summary_by_file_io_type and x$host_summary_by_file_io_type Views"><code class="literal">host_summary_by_file_io_type</code></a>
          and
          <a class="link" href="sys-schema.html#sys-host-summary-by-file-io-type" title="26.4.3.3 The host_summary_by_file_io_type and x$host_summary_by_file_io_type Views"><code class="literal">x$host_summary_by_file_io_type</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">host</code>
            </p><p>
              The host from which the client connected. Rows for which
              the <code class="literal">HOST</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">event_name</code>
            </p><p>
              The file I/O event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the file I/O event for
              the host.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the file I/O
              event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              file I/O event for the host.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-host-summary-by-stages"></a>26.4.3.4 The host_summary_by_stages and x$host_summary_by_stages Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899465468480"></a><a class="indexterm" name="idm139899465467024"></a><a class="indexterm" name="idm139899465465520"></a><a class="indexterm" name="idm139899465464016"></a><p>
          These views summarize statement stages, grouped by host. By
          default, rows are sorted by host and descending total latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-host-summary-by-stages" title="26.4.3.4 The host_summary_by_stages and x$host_summary_by_stages Views"><code class="literal">host_summary_by_stages</code></a> and
          <a class="link" href="sys-schema.html#sys-host-summary-by-stages" title="26.4.3.4 The host_summary_by_stages and x$host_summary_by_stages Views"><code class="literal">x$host_summary_by_stages</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">host</code>
            </p><p>
              The host from which the client connected. Rows for which
              the <code class="literal">HOST</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">event_name</code>
            </p><p>
              The stage event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the stage event for the
              host.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the stage
              event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the stage
              event for the host.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-host-summary-by-statement-latency"></a>26.4.3.5 The host_summary_by_statement_latency and
x$host_summary_by_statement_latency Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465445120"></a><a class="indexterm" name="idm139899465443664"></a><a class="indexterm" name="idm139899465442160"></a><a class="indexterm" name="idm139899465440640"></a><p>
          These views summarize overall statement statistics, grouped by
          host. By default, rows are sorted by descending total latency.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-host-summary-by-statement-latency" title="26.4.3.5 The host_summary_by_statement_latency and x$host_summary_by_statement_latency Views"><code class="literal">host_summary_by_statement_latency</code></a>
          and
          <a class="link" href="sys-schema.html#sys-host-summary-by-statement-latency" title="26.4.3.5 The host_summary_by_statement_latency and x$host_summary_by_statement_latency Views"><code class="literal">x$host_summary_by_statement_latency</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">host</code>
            </p><p>
              The host from which the client connected. Rows for which
              the <code class="literal">HOST</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of statements for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed statements for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed statements for the
              host.
            </p></li><li class="listitem"><p>
              <code class="literal">lock_latency</code>
            </p><p>
              The total time waiting for locks by timed statements for
              the host.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent</code>
            </p><p>
              The total number of rows returned by statements for the
              host.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined</code>
            </p><p>
              The total number of rows read from storage engines by
              statements for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_affected</code>
            </p><p>
              The total number of rows affected by statements for the
              host.
            </p></li><li class="listitem"><p>
              <code class="literal">full_scans</code>
            </p><p>
              The total number of full table scans by statements for the
              host.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-host-summary-by-statement-type"></a>26.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465413904"></a><a class="indexterm" name="idm139899465412448"></a><a class="indexterm" name="idm139899465410944"></a><a class="indexterm" name="idm139899465409440"></a><p>
          These views summarize informaion about statements executed,
          grouped by host and statement type. By default, rows are
          sorted by host and descending total latency.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-host-summary-by-statement-type" title="26.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type Views"><code class="literal">host_summary_by_statement_type</code></a>
          and
          <a class="link" href="sys-schema.html#sys-host-summary-by-statement-type" title="26.4.3.6 The host_summary_by_statement_type and x$host_summary_by_statement_type Views"><code class="literal">x$host_summary_by_statement_type</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">host</code>
            </p><p>
              The host from which the client connected. Rows for which
              the <code class="literal">HOST</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">statement</code>
            </p><p>
              The final component of the statement event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the statement event for
              the host.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the statement
              event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              statement event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">lock_latency</code>
            </p><p>
              The total time waiting for locks by timed occurrences of
              the statement event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent</code>
            </p><p>
              The total number of rows returned by occurrences of the
              statement event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined</code>
            </p><p>
              The total number of rows read from storage engines by
              occurrences of the statement event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_affected</code>
            </p><p>
              The total number of rows affected by occurrences of the
              statement event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">full_scans</code>
            </p><p>
              The total number of full table scans by occurrences of the
              statement event for the host.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-innodb-buffer-stats-by-schema"></a>26.4.3.7 The innodb_buffer_stats_by_schema and x$innodb_buffer_stats_by_schema
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465380480"></a><a class="indexterm" name="idm139899465379024"></a><a class="indexterm" name="idm139899465377520"></a><a class="indexterm" name="idm139899465376016"></a><p>
          These views summarize the information in the
          <code class="literal">INFORMATION_SCHEMA</code>
          <a class="link" href="information-schema.html#innodb-buffer-page-table" title="24.33.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table"><code class="literal">INNODB_BUFFER_PAGE</code></a> table, grouped
          by schema. By default, rows are sorted by descending buffer
          size.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-innodb-buffer-stats-by-schema" title="26.4.3.7 The innodb_buffer_stats_by_schema and x$innodb_buffer_stats_by_schema Views"><code class="literal">innodb_buffer_stats_by_schema</code></a>
          and
          <a class="link" href="sys-schema.html#sys-innodb-buffer-stats-by-schema" title="26.4.3.7 The innodb_buffer_stats_by_schema and x$innodb_buffer_stats_by_schema Views"><code class="literal">x$innodb_buffer_stats_by_schema</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">object_schema</code>
            </p><p>
              The schema name for the object, or <code class="literal">InnoDB
              System</code> if the table belongs to the
              <code class="literal">InnoDB</code> storage engine.
            </p></li><li class="listitem"><p>
              <code class="literal">allocated</code>
            </p><p>
              The total number of bytes allocated for the schema.
            </p></li><li class="listitem"><p>
              <code class="literal">data</code>
            </p><p>
              The total number of data bytes allocated for the schema.
            </p></li><li class="listitem"><p>
              <code class="literal">pages</code>
            </p><p>
              The total number of pages allocated for the schema.
            </p></li><li class="listitem"><p>
              <code class="literal">pages_hashed</code>
            </p><p>
              The total number of hashed pages allocated for the schema.
            </p></li><li class="listitem"><p>
              <code class="literal">pages_old</code>
            </p><p>
              The total number of old pages allocated for the schema.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_cached</code>
            </p><p>
              The total number of cached rows for the schema.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-innodb-buffer-stats-by-table"></a>26.4.3.8 The innodb_buffer_stats_by_table and x$innodb_buffer_stats_by_table
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465352176"></a><a class="indexterm" name="idm139899465350720"></a><a class="indexterm" name="idm139899465349216"></a><a class="indexterm" name="idm139899465347712"></a><p>
          These views summarize the information in the
          <code class="literal">INFORMATION_SCHEMA</code>
          <a class="link" href="information-schema.html#innodb-buffer-page-table" title="24.33.1 The INFORMATION_SCHEMA INNODB_BUFFER_PAGE Table"><code class="literal">INNODB_BUFFER_PAGE</code></a> table, grouped
          by schema and table. By default, rows are sorted by descending
          buffer size.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-innodb-buffer-stats-by-table" title="26.4.3.8 The innodb_buffer_stats_by_table and x$innodb_buffer_stats_by_table Views"><code class="literal">innodb_buffer_stats_by_table</code></a>
          and
          <a class="link" href="sys-schema.html#sys-innodb-buffer-stats-by-table" title="26.4.3.8 The innodb_buffer_stats_by_table and x$innodb_buffer_stats_by_table Views"><code class="literal">x$innodb_buffer_stats_by_table</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">object_schema</code>
            </p><p>
              The schema name for the object, or <code class="literal">InnoDB
              System</code> if the table belongs to the
              <code class="literal">InnoDB</code> storage engine.
            </p></li><li class="listitem"><p>
              <code class="literal">object_name</code>
            </p><p>
              The table name.
            </p></li><li class="listitem"><p>
              <code class="literal">allocated</code>
            </p><p>
              The total number of bytes allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">data</code>
            </p><p>
              The number of data bytes allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">pages</code>
            </p><p>
              The total number of pages allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">pages_hashed</code>
            </p><p>
              The number of hashed pages allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">pages_old</code>
            </p><p>
              The number of old pages allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_cached</code>
            </p><p>
              The number of cached rows for the table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-innodb-lock-waits"></a>26.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899465322064"></a><a class="indexterm" name="idm139899465320608"></a><a class="indexterm" name="idm139899465319120"></a><a class="indexterm" name="idm139899465317616"></a><p>
          These views summarize the <code class="literal">InnoDB</code> locks that
          transactions are waiting for. By default, rows are sorted by
          descending lock age.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-innodb-lock-waits" title="26.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views"><code class="literal">innodb_lock_waits</code></a> and
          <a class="link" href="sys-schema.html#sys-innodb-lock-waits" title="26.4.3.9 The innodb_lock_waits and x$innodb_lock_waits Views"><code class="literal">x$innodb_lock_waits</code></a> views have
          these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">wait_started</code>
            </p><p>
              The time at which the lock wait started.
            </p></li><li class="listitem"><p>
              <code class="literal">wait_age</code>
            </p><p>
              How long the lock has been waited for, as a
              <a class="link" href="data-types.html#time" title="11.3.2 The TIME Type"><code class="literal">TIME</code></a> value.
            </p></li><li class="listitem"><p>
              <code class="literal">wait_age_secs</code>
            </p><p>
              How long the lock has been waited for, in seconds.
            </p></li><li class="listitem"><p>
              <code class="literal">locked_table_schema</code>
            </p><p>
              The schema that contains the locked table.
            </p></li><li class="listitem"><p>
              <code class="literal">locked_table_name</code>
            </p><p>
              The name of the locked table.
            </p></li><li class="listitem"><p>
              <code class="literal">locked_table_partition</code>
            </p><p>
              The name of the locked partition, if any;
              <code class="literal">NULL</code> otherwise.
            </p></li><li class="listitem"><p>
              <code class="literal">locked_table_subpartition</code>
            </p><p>
              The name of the locked subpartition, if any;
              <code class="literal">NULL</code> otherwise.
            </p></li><li class="listitem"><p>
              <code class="literal">locked_index</code>
            </p><p>
              The name of the locked index.
            </p></li><li class="listitem"><p>
              <code class="literal">locked_type</code>
            </p><p>
              The type of the waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_trx_id</code>
            </p><p>
              The ID of the waiting transaction.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_trx_started</code>
            </p><p>
              The time at which the waiting transaction started.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_trx_age</code>
            </p><p>
              How long the waiting transaction has been waiting, as a
              <a class="link" href="data-types.html#time" title="11.3.2 The TIME Type"><code class="literal">TIME</code></a> value.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_trx_rows_locked</code>
            </p><p>
              The number of rows locked by the waiting transaction.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_trx_rows_modified</code>
            </p><p>
              The number of rows modified by the waiting transaction.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_pid</code>
            </p><p>
              The processlist ID of the waiting transaction.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_query</code>
            </p><p>
              The statement that is waiting for the lock.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_lock_id</code>
            </p><p>
              The ID of the waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_lock_mode</code>
            </p><p>
              The mode of the waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_trx_id</code>
            </p><p>
              The ID of the transaction that is blocking the waiting
              lock.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_pid</code>
            </p><p>
              The processlist ID of the blocking transaction.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_query</code>
            </p><p>
              The statement the blocking transaction is executing. This
              field reports NULL if the session that issued the blocking
              query becomes idle. For more information, see
              <a class="xref" href="innodb-storage-engine.html#innodb-information-schema-examples-null-blocking-query" title="Identifying a Blocking Query After the Issuing Session Becomes Idle">Identifying a Blocking Query After the Issuing Session Becomes Idle</a>.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_lock_id</code>
            </p><p>
              The ID of the lock that is blocking the waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_lock_mode</code>
            </p><p>
              The mode of the lock that is blocking the waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_trx_started</code>
            </p><p>
              The time at which the blocking transaction started.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_trx_age</code>
            </p><p>
              How long the blocking transaction has been executing, as a
              <a class="link" href="data-types.html#time" title="11.3.2 The TIME Type"><code class="literal">TIME</code></a> value.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_trx_rows_locked</code>
            </p><p>
              The number of rows locked by the blocking transaction.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_trx_rows_modified</code>
            </p><p>
              The number of rows modified by the blocking transaction.
            </p></li><li class="listitem"><p>
              <code class="literal">sql_kill_blocking_query</code>
            </p><p>
              The <a class="link" href="sql-syntax.html#kill" title="13.7.7.4 KILL Syntax"><code class="literal">KILL</code></a> statement to
              execute to kill the blocking statement.
            </p></li><li class="listitem"><p>
              <code class="literal">sql_kill_blocking_connection</code>
            </p><p>
              The <a class="link" href="sql-syntax.html#kill" title="13.7.7.4 KILL Syntax"><code class="literal">KILL</code></a> statement to
              execute to kill the session running the blocking
              statement.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-io-by-thread-by-latency"></a>26.4.3.10 The io_by_thread_by_latency and x$io_by_thread_by_latency Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899465245568"></a><a class="indexterm" name="idm139899465244112"></a><a class="indexterm" name="idm139899465242608"></a><a class="indexterm" name="idm139899465241104"></a><p>
          These views summarize I/O consumers to display time waiting
          for I/O, grouped by thread. By default, rows are sorted by
          descending total I/O latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-io-by-thread-by-latency" title="26.4.3.10 The io_by_thread_by_latency and x$io_by_thread_by_latency Views"><code class="literal">io_by_thread_by_latency</code></a> and
          <a class="link" href="sys-schema.html#sys-io-by-thread-by-latency" title="26.4.3.10 The io_by_thread_by_latency and x$io_by_thread_by_latency Views"><code class="literal">x$io_by_thread_by_latency</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              For foreground threads, the account associated with the
              thread. For background threads, the thread name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of I/O events for the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed I/O events for the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">min_latency</code>
            </p><p>
              The minimum single wait time of timed I/O events for the
              thread.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed I/O event for the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed I/O events for the
              thread.
            </p></li><li class="listitem"><p>
              <code class="literal">thread_id</code>
            </p><p>
              The thread ID.
            </p></li><li class="listitem"><p>
              <code class="literal">processlist_id</code>
            </p><p>
              For foreground threads, the processlist ID of the thread.
              For background threads, <code class="literal">NULL</code>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-io-global-by-file-by-bytes"></a>26.4.3.11 The io_global_by_file_by_bytes and x$io_global_by_file_by_bytes Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899465217936"></a><a class="indexterm" name="idm139899465216480"></a><a class="indexterm" name="idm139899465214976"></a><a class="indexterm" name="idm139899465213472"></a><p>
          These views summarize global I/O consumers to display amount
          of I/O, grouped by file. By default, rows are sorted by
          descending total I/O (bytes read and written).
        </p><p>
          The <a class="link" href="sys-schema.html#sys-io-global-by-file-by-bytes" title="26.4.3.11 The io_global_by_file_by_bytes and x$io_global_by_file_by_bytes Views"><code class="literal">io_global_by_file_by_bytes</code></a>
          and <a class="link" href="sys-schema.html#sys-io-global-by-file-by-bytes" title="26.4.3.11 The io_global_by_file_by_bytes and x$io_global_by_file_by_bytes Views"><code class="literal">x$io_global_by_file_by_bytes</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">file</code>
            </p><p>
              The file path name.
            </p></li><li class="listitem"><p>
              <code class="literal">count_read</code>
            </p><p>
              The total number of read events for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">total_read</code>
            </p><p>
              The total number of bytes read from the file.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_read</code>
            </p><p>
              The average number of bytes per read from the file.
            </p></li><li class="listitem"><p>
              <code class="literal">count_write</code>
            </p><p>
              The total number of write events for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">total_written</code>
            </p><p>
              The total number of bytes written to the file.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_write</code>
            </p><p>
              The average number of bytes per write to the file.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of bytes read and written for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">write_pct</code>
            </p><p>
              The percentage of total bytes of I/O that were writes.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-io-global-by-file-by-latency"></a>26.4.3.12 The io_global_by_file_by_latency and x$io_global_by_file_by_latency
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465189200"></a><a class="indexterm" name="idm139899465187744"></a><a class="indexterm" name="idm139899465186240"></a><a class="indexterm" name="idm139899465184736"></a><p>
          These views summarize global I/O consumers to display time
          waiting for I/O, grouped by file. By default, rows are sorted
          by descending total latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-io-global-by-file-by-latency" title="26.4.3.12 The io_global_by_file_by_latency and x$io_global_by_file_by_latency Views"><code class="literal">io_global_by_file_by_latency</code></a>
          and
          <a class="link" href="sys-schema.html#sys-io-global-by-file-by-latency" title="26.4.3.12 The io_global_by_file_by_latency and x$io_global_by_file_by_latency Views"><code class="literal">x$io_global_by_file_by_latency</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">file</code>
            </p><p>
              The file path name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of I/O events for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed I/O events for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">count_read</code>
            </p><p>
              The total number of read I/O events for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">read_latency</code>
            </p><p>
              The total wait time of timed read I/O events for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">count_write</code>
            </p><p>
              The total number of write I/O events for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">write_latency</code>
            </p><p>
              The total wait time of timed write I/O events for the
              file.
            </p></li><li class="listitem"><p>
              <code class="literal">count_misc</code>
            </p><p>
              The total number of other I/O events for the file.
            </p></li><li class="listitem"><p>
              <code class="literal">misc_latency</code>
            </p><p>
              The total wait time of timed other I/O events for the
              file.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-io-global-by-wait-by-bytes"></a>26.4.3.13 The io_global_by_wait_by_bytes and x$io_global_by_wait_by_bytes Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899465160448"></a><a class="indexterm" name="idm139899465158992"></a><a class="indexterm" name="idm139899465157488"></a><a class="indexterm" name="idm139899465155984"></a><p>
          These views summarize global I/O consumers to display amount
          of I/O and time waiting for I/O, grouped by event. By default,
          rows are sorted by descending total I/O (bytes read and
          written).
        </p><p>
          The <a class="link" href="sys-schema.html#sys-io-global-by-wait-by-bytes" title="26.4.3.13 The io_global_by_wait_by_bytes and x$io_global_by_wait_by_bytes Views"><code class="literal">io_global_by_wait_by_bytes</code></a>
          and <a class="link" href="sys-schema.html#sys-io-global-by-wait-by-bytes" title="26.4.3.13 The io_global_by_wait_by_bytes and x$io_global_by_wait_by_bytes Views"><code class="literal">x$io_global_by_wait_by_bytes</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">event_name</code>
            </p><p>
              The I/O event name, with the
              <code class="literal">wait/io/file/</code> prefix stripped.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">min_latency</code>
            </p><p>
              The minimum single wait time of timed occurrences of the
              I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the I/O
              event.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">count_read</code>
            </p><p>
              The number of read requests for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">total_read</code>
            </p><p>
              The number of bytes read for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_read</code>
            </p><p>
              The average number of bytes per read for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">count_write</code>
            </p><p>
              The number of write requests for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">total_written</code>
            </p><p>
              The number of bytes written for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_written</code>
            </p><p>
              The average number of bytes per write for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">total_requested</code>
            </p><p>
              The total number of bytes read and written for the I/O
              event.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-io-global-by-wait-by-latency"></a>26.4.3.14 The io_global_by_wait_by_latency and x$io_global_by_wait_by_latency
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465123104"></a><a class="indexterm" name="idm139899465121648"></a><a class="indexterm" name="idm139899465120144"></a><a class="indexterm" name="idm139899465118640"></a><p>
          These views summarize global I/O consumers to display amount
          of I/O and time waiting for I/O, grouped by event. By default,
          rows are sorted by descending total latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-io-global-by-wait-by-latency" title="26.4.3.14 The io_global_by_wait_by_latency and x$io_global_by_wait_by_latency Views"><code class="literal">io_global_by_wait_by_latency</code></a>
          and
          <a class="link" href="sys-schema.html#sys-io-global-by-wait-by-latency" title="26.4.3.14 The io_global_by_wait_by_latency and x$io_global_by_wait_by_latency Views"><code class="literal">x$io_global_by_wait_by_latency</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">event_name</code>
            </p><p>
              The I/O event name, with the
              <code class="literal">wait/io/file/</code> prefix stripped.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the I/O
              event.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">read_latency</code>
            </p><p>
              The total wait time of timed read occurrences of the I/O
              event.
            </p></li><li class="listitem"><p>
              <code class="literal">write_latency</code>
            </p><p>
              The total wait time of timed write occurrences of the I/O
              event.
            </p></li><li class="listitem"><p>
              <code class="literal">misc_latency</code>
            </p><p>
              The total wait time of timed other occurrences of the I/O
              event.
            </p></li><li class="listitem"><p>
              <code class="literal">count_read</code>
            </p><p>
              The number of read requests for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">total_read</code>
            </p><p>
              The number of bytes read for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_read</code>
            </p><p>
              The average number of bytes per read for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">count_write</code>
            </p><p>
              The number of write requests for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">total_written</code>
            </p><p>
              The number of bytes written for the I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_written</code>
            </p><p>
              The average number of bytes per write for the I/O event.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-latest-file-io"></a>26.4.3.15 The latest_file_io and x$latest_file_io Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899465083936"></a><a class="indexterm" name="idm139899465082480"></a><a class="indexterm" name="idm139899465080992"></a><a class="indexterm" name="idm139899465079504"></a><p>
          These views summarize file I/O activity, grouped by file and
          thread. By default, rows are sorted with most recent I/O
          first.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-latest-file-io" title="26.4.3.15 The latest_file_io and x$latest_file_io Views"><code class="literal">latest_file_io</code></a> and
          <a class="link" href="sys-schema.html#sys-latest-file-io" title="26.4.3.15 The latest_file_io and x$latest_file_io Views"><code class="literal">x$latest_file_io</code></a> views have
          these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">thread</code>
            </p><p>
              For foreground threads, the account associated with the
              thread (and port number for TCP/IP connections). For
              background threads, the thread name and thread ID
            </p></li><li class="listitem"><p>
              <code class="literal">file</code>
            </p><p>
              The file path name.
            </p></li><li class="listitem"><p>
              <code class="literal">latency</code>
            </p><p>
              The wait time of the file I/O event.
            </p></li><li class="listitem"><p>
              <code class="literal">operation</code>
            </p><p>
              The type of operation.
            </p></li><li class="listitem"><p>
              <code class="literal">requested</code>
            </p><p>
              The number of data bytes requested for the file I/O event.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-memory-by-host-by-current-bytes"></a>26.4.3.16 The memory_by_host_by_current_bytes and
x$memory_by_host_by_current_bytes Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465063040"></a><a class="indexterm" name="idm139899465061584"></a><a class="indexterm" name="idm139899465060080"></a><a class="indexterm" name="idm139899465058576"></a><p>
          These views summarize memory use, grouped by host. By default,
          rows are sorted by descending amount of memory used.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-memory-by-host-by-current-bytes" title="26.4.3.16 The memory_by_host_by_current_bytes and x$memory_by_host_by_current_bytes Views"><code class="literal">memory_by_host_by_current_bytes</code></a>
          and
          <a class="link" href="sys-schema.html#sys-memory-by-host-by-current-bytes" title="26.4.3.16 The memory_by_host_by_current_bytes and x$memory_by_host_by_current_bytes Views"><code class="literal">x$memory_by_host_by_current_bytes</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">host</code>
            </p><p>
              The host from which the client connected. Rows for which
              the <code class="literal">HOST</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">current_count_used</code>
            </p><p>
              The current number of allocated memory blocks that have
              not been freed yet for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">current_allocated</code>
            </p><p>
              The current number of allocated bytes that have not been
              freed yet for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">current_avg_alloc</code>
            </p><p>
              The current number of allocated bytes per memory block for
              the host.
            </p></li><li class="listitem"><p>
              <code class="literal">current_max_alloc</code>
            </p><p>
              The largest single current memory allocation in bytes for
              the host.
            </p></li><li class="listitem"><p>
              <code class="literal">total_allocated</code>
            </p><p>
              The total memory allocation in bytes for the host.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-memory-by-thread-by-current-bytes"></a>26.4.3.17 The memory_by_thread_by_current_bytes and
x$memory_by_thread_by_current_bytes Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465037616"></a><a class="indexterm" name="idm139899465036160"></a><a class="indexterm" name="idm139899465034656"></a><a class="indexterm" name="idm139899465033136"></a><p>
          These views summarize memory use, grouped by thread. By
          default, rows are sorted by descending amount of memory used.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-memory-by-thread-by-current-bytes" title="26.4.3.17 The memory_by_thread_by_current_bytes and x$memory_by_thread_by_current_bytes Views"><code class="literal">memory_by_thread_by_current_bytes</code></a>
          and
          <a class="link" href="sys-schema.html#sys-memory-by-thread-by-current-bytes" title="26.4.3.17 The memory_by_thread_by_current_bytes and x$memory_by_thread_by_current_bytes Views"><code class="literal">x$memory_by_thread_by_current_bytes</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">thread_id</code>
            </p><p>
              The thread ID.
            </p></li><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The thread user or thread name.
            </p></li><li class="listitem"><p>
              <code class="literal">current_count_used</code>
            </p><p>
              The current number of allocated memory blocks that have
              not been freed yet for the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">current_allocated</code>
            </p><p>
              The current number of allocated bytes that have not been
              freed yet for the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">current_avg_alloc</code>
            </p><p>
              The current number of allocated bytes per memory block for
              the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">current_max_alloc</code>
            </p><p>
              The largest single current memory allocation in bytes for
              the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">total_allocated</code>
            </p><p>
              The total memory allocation in bytes for the thread.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-memory-by-user-by-current-bytes"></a>26.4.3.18 The memory_by_user_by_current_bytes and
x$memory_by_user_by_current_bytes Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899465012592"></a><a class="indexterm" name="idm139899465011136"></a><a class="indexterm" name="idm139899465009632"></a><a class="indexterm" name="idm139899465008128"></a><p>
          These views summarize memory use, grouped by user. By default,
          rows are sorted by descending amount of memory used.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-memory-by-user-by-current-bytes" title="26.4.3.18 The memory_by_user_by_current_bytes and x$memory_by_user_by_current_bytes Views"><code class="literal">memory_by_user_by_current_bytes</code></a>
          and
          <a class="link" href="sys-schema.html#sys-memory-by-user-by-current-bytes" title="26.4.3.18 The memory_by_user_by_current_bytes and x$memory_by_user_by_current_bytes Views"><code class="literal">x$memory_by_user_by_current_bytes</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The client user name. Rows for which the
              <code class="literal">USER</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">current_count_used</code>
            </p><p>
              The current number of allocated memory blocks that have
              not been freed yet for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">current_allocated</code>
            </p><p>
              The current number of allocated bytes that have not been
              freed yet for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">current_avg_alloc</code>
            </p><p>
              The current number of allocated bytes per memory block for
              the user.
            </p></li><li class="listitem"><p>
              <code class="literal">current_max_alloc</code>
            </p><p>
              The largest single current memory allocation in bytes for
              the user.
            </p></li><li class="listitem"><p>
              <code class="literal">total_allocated</code>
            </p><p>
              The total memory allocation in bytes for the user.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-memory-global-by-current-bytes"></a>26.4.3.19 The memory_global_by_current_bytes and x$memory_global_by_current_bytes
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464987216"></a><a class="indexterm" name="idm139899464985760"></a><a class="indexterm" name="idm139899464984256"></a><a class="indexterm" name="idm139899464982752"></a><p>
          These views summarize memory use, grouped by allocation type
          (that is, by event). By default, rows are sorted by descending
          amount of memory used.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-memory-global-by-current-bytes" title="26.4.3.19 The memory_global_by_current_bytes and x$memory_global_by_current_bytes Views"><code class="literal">memory_global_by_current_bytes</code></a>
          and
          <a class="link" href="sys-schema.html#sys-memory-global-by-current-bytes" title="26.4.3.19 The memory_global_by_current_bytes and x$memory_global_by_current_bytes Views"><code class="literal">x$memory_global_by_current_bytes</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">event_name</code>
            </p><p>
              The memory event name.
            </p></li><li class="listitem"><p>
              <code class="literal">current_count</code>
            </p><p>
              The total number of occurrences of the event.
            </p></li><li class="listitem"><p>
              <code class="literal">current_alloc</code>
            </p><p>
              The current number of allocated bytes that have not been
              freed yet for the event.
            </p></li><li class="listitem"><p>
              <code class="literal">current_avg_alloc</code>
            </p><p>
              The current number of allocated bytes per memory block for
              the event.
            </p></li><li class="listitem"><p>
              <code class="literal">high_count</code>
            </p><p>
              The high-water mark for number of memory blocks allocated
              for the event.
            </p></li><li class="listitem"><p>
              <code class="literal">high_alloc</code>
            </p><p>
              The high-water mark for number of bytes allocated for the
              event.
            </p></li><li class="listitem"><p>
              <code class="literal">high_avg_alloc</code>
            </p><p>
              The high-water mark for average number of bytes per memory
              block allocated for the event.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-memory-global-total"></a>26.4.3.20 The memory_global_total and x$memory_global_total Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464962224"></a><a class="indexterm" name="idm139899464960752"></a><a class="indexterm" name="idm139899464959248"></a><a class="indexterm" name="idm139899464957744"></a><p>
          These views summarize total memory use within the server.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-memory-global-total" title="26.4.3.20 The memory_global_total and x$memory_global_total Views"><code class="literal">memory_global_total</code></a> and
          <a class="link" href="sys-schema.html#sys-memory-global-total" title="26.4.3.20 The memory_global_total and x$memory_global_total Views"><code class="literal">x$memory_global_total</code></a> views have
          these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">total_allocated</code>
            </p><p>
              The total bytes of memory allocated within the server.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-metrics"></a>26.4.3.21 The metrics View</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464949296"></a><a class="indexterm" name="idm139899464947808"></a><p>
          This view summarizes MySQL server metrics to show variable
          names, values, types, and whether they are enabled. By
          default, rows are sorted by variable type and name.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View"><code class="literal">metrics</code></a> view includes this
          information:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Global status variables from the Performance Schema
              <a class="link" href="performance-schema.html#performance-schema-status-variable-tables" title="25.11.14 Performance Schema Status Variable Tables"><code class="literal">global_status</code></a> table
            </p></li><li class="listitem"><p>
              <code class="literal">InnoDB</code> metrics from the
              <code class="literal">INFORMATION_SCHEMA</code>
              <a class="link" href="information-schema.html#innodb-metrics-table" title="24.33.16 The INFORMATION_SCHEMA INNODB_METRICS Table"><code class="literal">INNODB_METRICS</code></a> table
            </p></li><li class="listitem"><p>
              Current and total memory allocation, based on the
              Performance Schema memory instrumentation
            </p></li><li class="listitem"><p>
              The current time (human readable and Unix timestamp
              formats)
</p></li></ul>
</div>
<p>
          There is some duplication of information between the
          <a class="link" href="performance-schema.html#performance-schema-status-variable-tables" title="25.11.14 Performance Schema Status Variable Tables"><code class="literal">global_status</code></a> and
          <a class="link" href="information-schema.html#innodb-metrics-table" title="24.33.16 The INFORMATION_SCHEMA INNODB_METRICS Table"><code class="literal">INNODB_METRICS</code></a> tables, which the
          <a class="link" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View"><code class="literal">metrics</code></a> view eliminates.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View"><code class="literal">metrics</code></a> view has these
          columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">Variable_name</code>
            </p><p>
              The metric name. The metric type determines the source
              from which the name is taken:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  For global status variables: The
                  <code class="literal">VARIABLE_NAME</code> column of the
                  <a class="link" href="performance-schema.html#performance-schema-status-variable-tables" title="25.11.14 Performance Schema Status Variable Tables"><code class="literal">global_status</code></a> table
                </p></li><li class="listitem"><p>
                  For <code class="literal">InnoDB</code> metrics: The
                  <code class="literal">NAME</code> column of the
                  <a class="link" href="information-schema.html#innodb-metrics-table" title="24.33.16 The INFORMATION_SCHEMA INNODB_METRICS Table"><code class="literal">INNODB_METRICS</code></a> table
                </p></li><li class="listitem"><p>
                  For other metrics: A view-provided descriptive string
</p></li></ul>
</div>
</li><li class="listitem"><p>
              <code class="literal">Variable_value</code>
            </p><p>
              The metric value. The metric type determines the source
              from which the value is taken:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  For global status variables: The
                  <code class="literal">VARIABLE_VALUE</code> column of the
                  <a class="link" href="performance-schema.html#performance-schema-status-variable-tables" title="25.11.14 Performance Schema Status Variable Tables"><code class="literal">global_status</code></a> table
                </p></li><li class="listitem"><p>
                  For <code class="literal">InnoDB</code> metrics: The
                  <code class="literal">COUNT</code> column of the
                  <a class="link" href="information-schema.html#innodb-metrics-table" title="24.33.16 The INFORMATION_SCHEMA INNODB_METRICS Table"><code class="literal">INNODB_METRICS</code></a> table
                </p></li><li class="listitem"><p>
                  For memory metrics: The relevant column from the
                  Performance Schema
                  <a class="link" href="performance-schema.html#memory-summary-tables" title="25.11.15.10 Memory Summary Tables"><code class="literal">memory_summary_global_by_event_name</code></a>
                  table
                </p></li><li class="listitem"><p>
                  For the current time: The value of
                  <a class="link" href="functions.html#function_now"><code class="literal">NOW(3)</code></a> or
                  <a class="link" href="functions.html#function_unix-timestamp"><code class="literal">UNIX_TIMESTAMP(NOW(3))</code></a>
</p></li></ul>
</div>
</li><li class="listitem"><p>
              <code class="literal">Type</code>
            </p><p>
              The metric type:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  For global status variables: <code class="literal">Global
                  Status</code>
                </p></li><li class="listitem"><p>
                  For <code class="literal">InnoDB</code> metrics: <code class="literal">InnoDB
                  Metrics - %</code>, where <code class="literal">%</code> is
                  replaced by the value of the
                  <code class="literal">SUBSYSTEM</code> column of the
                  <a class="link" href="information-schema.html#innodb-metrics-table" title="24.33.16 The INFORMATION_SCHEMA INNODB_METRICS Table"><code class="literal">INNODB_METRICS</code></a> table
                </p></li><li class="listitem"><p>
                  For memory metrics: <code class="literal">Performance
                  Schema</code>
                </p></li><li class="listitem"><p>
                  For the current time: <code class="literal">System Time</code>
</p></li></ul>
</div>
</li><li class="listitem"><p>
              <code class="literal">Enabled</code>
            </p><p>
              Whether the metric is enabled:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                  For global status variables: <code class="literal">YES</code>
                </p></li><li class="listitem"><p>
                  For <code class="literal">InnoDB</code> metrics:
                  <code class="literal">YES</code> if the
                  <code class="literal">STATUS</code> column of the
                  <a class="link" href="information-schema.html#innodb-metrics-table" title="24.33.16 The INFORMATION_SCHEMA INNODB_METRICS Table"><code class="literal">INNODB_METRICS</code></a> table is
                  <code class="literal">enabled</code>, <code class="literal">NO</code>
                  otherwise
                </p></li><li class="listitem"><p>
                  For memory metrics: <code class="literal">NO</code>,
                  <code class="literal">YES</code>, or <code class="literal">PARTIAL</code>
                  (currently, <code class="literal">PARTIAL</code> occurs only for
                  memory metrics and indicates that not all
                  <code class="literal">memory/%</code> instruments are enabled;
                  Performance Schema memory instruments are always
                  enabled)
                </p></li><li class="listitem"><p>
                  For the current time: <code class="literal">YES</code>
</p></li></ul>
</div>
</li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-processlist"></a>26.4.3.22 The processlist and x$processlist Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464876752"></a><a class="indexterm" name="idm139899464875296"></a><a class="indexterm" name="idm139899464873808"></a><a class="indexterm" name="idm139899464872320"></a><p>
          These views summarize processlist information. They provide
          more complete information than the <a class="link" href="sql-syntax.html#show-processlist" title="13.7.6.29 SHOW PROCESSLIST Syntax"><code class="literal">SHOW
          PROCESSLIST</code></a> statement and the
          <code class="literal">INFORMATION_SCHEMA</code>
          <a class="link" href="information-schema.html#processlist-table" title="24.16 The INFORMATION_SCHEMA PROCESSLIST Table"><code class="literal">PROCESSLIST</code></a> table, and are also
          nonblocking. By default, rows are sorted by descending process
          time and descending wait time.
        </p><p>
          The column descriptions here are brief. For additional
          information, see the description of the Performance Schema
          <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a> table at
          <a class="xref" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table">Section 25.11.16.3, “The threads Table”</a>.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-processlist" title="26.4.3.22 The processlist and x$processlist Views"><code class="literal">processlist</code></a> and
          <a class="link" href="sys-schema.html#sys-processlist" title="26.4.3.22 The processlist and x$processlist Views"><code class="literal">x$processlist</code></a> views have these
          columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">thd_id</code>
            </p><p>
              The thread ID.
            </p></li><li class="listitem"><p>
              <code class="literal">conn_id</code>
            </p><p>
              The connection ID.
            </p></li><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The thread user or thread name.
            </p></li><li class="listitem"><p>
              <code class="literal">db</code>
            </p><p>
              The default database for the thread, or
              <code class="literal">NULL</code> if there is none.
            </p></li><li class="listitem"><p>
              <code class="literal">command</code>
            </p><p>
              For foreground threads, the type of command the thread is
              executing on behalf of the client, or
              <code class="literal">Sleep</code> if the session is idle.
            </p></li><li class="listitem"><p>
              <code class="literal">state</code>
            </p><p>
              An action, event, or state that indicates what the thread
              is doing.
            </p></li><li class="listitem"><p>
              <code class="literal">time</code>
            </p><p>
              The time in seconds that the thread has been in its
              current state.
            </p></li><li class="listitem"><p>
              <code class="literal">current_statement</code>
            </p><p>
              The statement the thread is executing, or
              <code class="literal">NULL</code> if it is not executing any
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">statement_latency</code>
            </p><p>
              How long the statement has been executing.
            </p></li><li class="listitem"><p>
              <code class="literal">progress</code>
            </p><p>
              The percentage of work completed for stages that support
              progress reporting. See
              <a class="xref" href="sys-schema.html#sys-schema-progress-reporting" title="26.3 sys Schema Progress Reporting">Section 26.3, “sys Schema Progress Reporting”</a>.
            </p></li><li class="listitem"><p>
              <code class="literal">lock_latency</code>
            </p><p>
              The time spent waiting for locks by the current statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined</code>
            </p><p>
              The number of rows read from storage engines by the
              current statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent</code>
            </p><p>
              The number of rows returned by the current statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_affected</code>
            </p><p>
              The number of rows affected by the current statement.
            </p></li><li class="listitem"><p>
              <code class="literal">tmp_tables</code>
            </p><p>
              The number of internal in-memory temporary tables created
              by the current statement.
            </p></li><li class="listitem"><p>
              <code class="literal">tmp_disk_tables</code>
            </p><p>
              The number of internal on-disk temporary tables created by
              the current statement.
            </p></li><li class="listitem"><p>
              <code class="literal">full_scan</code>
            </p><p>
              The number of full table scans performed by the current
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">last_statement</code>
            </p><p>
              The last statement executed by the thread, if there is no
              currently executing statement or wait.
            </p></li><li class="listitem"><p>
              <code class="literal">last_statement_latency</code>
            </p><p>
              How long the last statement executed.
            </p></li><li class="listitem"><p>
              <code class="literal">current_memory</code>
            </p><p>
              The number of bytes allocated by the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">last_wait</code>
            </p><p>
              The name of the most recent wait event for the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">last_wait_latency</code>
            </p><p>
              The wait time of the most recent wait event for the
              thread.
            </p></li><li class="listitem"><p>
              <code class="literal">source</code>
            </p><p>
              The source file and line number containing the
              instrumented code that produced the event.
            </p></li><li class="listitem"><p>
              <code class="literal">trx_latency</code>
            </p><p>
              The wait time of the current transaction for the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">trx_state</code>
            </p><p>
              The state for the current transaction for the thread.
            </p></li><li class="listitem"><p>
              <code class="literal">trx_autocommit</code>
            </p><p>
              Whether autocommit mode was enabled when the current
              transaction started.
            </p></li><li class="listitem"><p>
              <code class="literal">pid</code>
            </p><p>
              The client process ID.
            </p></li><li class="listitem"><p>
              <code class="literal">program_name</code>
            </p><p>
              The client program name.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-check-lost-instrumentation"></a>26.4.3.23 The ps_check_lost_instrumentation View</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464801744"></a><a class="indexterm" name="idm139899464800240"></a><p>
          This view returns information about lost Performance Schema
          instruments, to indicate whether the Performance Schema is
          unable to monitor all runtime data.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-ps-check-lost-instrumentation" title="26.4.3.23 The ps_check_lost_instrumentation View"><code class="literal">ps_check_lost_instrumentation</code></a>
          view has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">variable_name</code>
            </p><p>
              The Performance Schema status variable name indicating
              which type of instrument was lost.
            </p></li><li class="listitem"><p>
              <code class="literal">variable_value</code>
            </p><p>
              The number of instruments lost.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-auto-increment-columns"></a>26.4.3.24 The schema_auto_increment_columns View</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464790832"></a><a class="indexterm" name="idm139899464789328"></a><p>
          This view indicates which tables have
          <code class="literal">AUTO_INCREMENT</code> columns and provides
          information about those columns, such as the current and
          maximum column values and the usage ratio (ratio of used to
          possible values). By default, rows are sorted by descending
          usage ratio and maximum column value.
        </p><p>
          Tables in these schemas are excluded from view output:
          <code class="literal">mysql</code>, <code class="literal">sys</code>,
          <code class="literal">INFORMATION_SCHEMA</code>,
          <code class="literal">performance_schema</code>.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-schema-auto-increment-columns" title="26.4.3.24 The schema_auto_increment_columns View"><code class="literal">schema_auto_increment_columns</code></a>
          view has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">table_schema</code>
            </p><p>
              The schema that contains the table.
            </p></li><li class="listitem"><p>
              <code class="literal">table_name</code>
            </p><p>
              The table that contains the
              <code class="literal">AUTO_INCREMENT</code> column.
            </p></li><li class="listitem"><p>
              <code class="literal">column_name</code>
            </p><p>
              The name of the <code class="literal">AUTO_INCREMENT</code> column.
            </p></li><li class="listitem"><p>
              <code class="literal">data_type</code>
            </p><p>
              The data type of the column.
            </p></li><li class="listitem"><p>
              <code class="literal">column_type</code>
            </p><p>
              The column type of the column, which is the data type plus
              possibly other information. For example, for a column with
              a <code class="literal">bigint(20) unsigned</code> column type, the
              data type is just <code class="literal">bigint</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">is_signed</code>
            </p><p>
              Whether the column type is signed.
            </p></li><li class="listitem"><p>
              <code class="literal">is_unsigned</code>
            </p><p>
              Whether the column type is unsigned.
            </p></li><li class="listitem"><p>
              <code class="literal">max_value</code>
            </p><p>
              The maximum permitted value for the column.
            </p></li><li class="listitem"><p>
              <code class="literal">auto_increment</code>
            </p><p>
              The current <code class="literal">AUTO_INCREMENT</code> value for
              the column.
            </p></li><li class="listitem"><p>
              <code class="literal">auto_increment_ratio</code>
            </p><p>
              The ratio of used to permitted values for the column. This
              indicates how much of the sequence of values is
              <span class="quote">“<span class="quote">used up.</span>”</span>
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-index-statistics"></a>26.4.3.25 The schema_index_statistics and x$schema_index_statistics Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464756192"></a><a class="indexterm" name="idm139899464754736"></a><a class="indexterm" name="idm139899464753232"></a><a class="indexterm" name="idm139899464751728"></a><p>
          These views provide index statistics. By default, rows are
          sorted by descending total index latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-schema-index-statistics" title="26.4.3.25 The schema_index_statistics and x$schema_index_statistics Views"><code class="literal">schema_index_statistics</code></a> and
          <a class="link" href="sys-schema.html#sys-schema-index-statistics" title="26.4.3.25 The schema_index_statistics and x$schema_index_statistics Views"><code class="literal">x$schema_index_statistics</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">table_schema</code>
            </p><p>
              The schema that contains the table.
            </p></li><li class="listitem"><p>
              <code class="literal">table_name</code>
            </p><p>
              The table that contains the index.
            </p></li><li class="listitem"><p>
              <code class="literal">index_name</code>
            </p><p>
              The name of the index.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_selected</code>
            </p><p>
              The total number of rows read using the index.
            </p></li><li class="listitem"><p>
              <code class="literal">select_latency</code>
            </p><p>
              The total wait time of timed reads using the index.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_inserted</code>
            </p><p>
              The total number of rows inserted into the index.
            </p></li><li class="listitem"><p>
              <code class="literal">insert_latency</code>
            </p><p>
              The total wait time of timed inserts into the index.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_updated</code>
            </p><p>
              The total number of rows updated in the index.
            </p></li><li class="listitem"><p>
              <code class="literal">update_latency</code>
            </p><p>
              The total wait time of timed updates in the index.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_deleted</code>
            </p><p>
              The total number of rows deleted from the index.
            </p></li><li class="listitem"><p>
              <code class="literal">delete_latency</code>
            </p><p>
              The total wait time of timed deletes from the index.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-object-overview"></a>26.4.3.26 The schema_object_overview View</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464723808"></a><a class="indexterm" name="idm139899464722304"></a><p>
          This view summarizes the types of objects within each schema.
          By default, rows are sorted by schema and object type.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            For MySQL instances with a large number of objects, this
            view might take a long time to execute.
</p>
</div>
<p>
          The <a class="link" href="sys-schema.html#sys-schema-object-overview" title="26.4.3.26 The schema_object_overview View"><code class="literal">schema_object_overview</code></a> view
          has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">db</code>
            </p><p>
              The schema name.
            </p></li><li class="listitem"><p>
              <code class="literal">object_type</code>
            </p><p>
              The object type: <code class="literal">BASE TABLE</code>,
              <code class="literal">INDEX
              (<em class="replaceable"><code>index_type</code></em>)</code>,
              <code class="literal">EVENT</code>, <code class="literal">FUNCTION</code>,
              <code class="literal">PROCEDURE</code>, <code class="literal">TRIGGER</code>,
              <code class="literal">VIEW</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">count</code>
            </p><p>
              The number of objects in the schema of the given type.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-redundant-indexes"></a>26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464704800"></a><a class="indexterm" name="idm139899464703344"></a><a class="indexterm" name="idm139899464701840"></a><a class="indexterm" name="idm139899464700336"></a><p>
          The <a class="link" href="sys-schema.html#sys-schema-redundant-indexes" title="26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views"><code class="literal">schema_redundant_indexes</code></a>
          view displays indexes that duplicate other indexes or are made
          redundant by them. The
          <a class="link" href="sys-schema.html#sys-schema-redundant-indexes" title="26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views"><code class="literal">x$schema_flattened_keys</code></a>
          view is a helper view for
          <a class="link" href="sys-schema.html#sys-schema-redundant-indexes" title="26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views"><code class="literal">schema_redundant_indexes</code></a>.
        </p><p>
          In the following column descriptions, the dominant index is
          the one that makes the redundant index redundant.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-schema-redundant-indexes" title="26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views"><code class="literal">schema_redundant_indexes</code></a>
          view has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">table_schema</code>
            </p><p>
              The schema that contains the table.
            </p></li><li class="listitem"><p>
              <code class="literal">table_name</code>
            </p><p>
              The table that contains the index.
            </p></li><li class="listitem"><p>
              <code class="literal">redundant_index_name</code>
            </p><p>
              The name of the redundant index.
            </p></li><li class="listitem"><p>
              <code class="literal">redundant_index_columns</code>
            </p><p>
              The names of the columns in the redundant index.
            </p></li><li class="listitem"><p>
              <code class="literal">redundant_index_non_unique</code>
            </p><p>
              The number of nonunique columns in the redundant index.
            </p></li><li class="listitem"><p>
              <code class="literal">dominant_index_name</code>
            </p><p>
              The name of the dominant index.
            </p></li><li class="listitem"><p>
              <code class="literal">dominant_index_columns</code>
            </p><p>
              The names of the columns in the dominant index.
            </p></li><li class="listitem"><p>
              <code class="literal">dominant_index_non_unique</code>
            </p><p>
              The number of nonunique columns in the dominant index.
            </p></li><li class="listitem"><p>
              <code class="literal">subpart_exists</code>
            </p><p>
              Whether the index indexes only part of a column.
            </p></li><li class="listitem"><p>
              <code class="literal">sql_drop_index</code>
            </p><p>
              The statement to execute to drop the redundant index.
</p></li></ul>
</div>
<p>
          The
          <a class="link" href="sys-schema.html#sys-schema-redundant-indexes" title="26.4.3.27 The schema_redundant_indexes and x$schema_flattened_keys Views"><code class="literal">x$schema_flattened_keys</code></a>
          view has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">table_schema</code>
            </p><p>
              The schema that contains the table.
            </p></li><li class="listitem"><p>
              <code class="literal">table_name</code>
            </p><p>
              The table that contains the index.
            </p></li><li class="listitem"><p>
              <code class="literal">index_name</code>
            </p><p>
              An index name.
            </p></li><li class="listitem"><p>
              <code class="literal">non_unique</code>
            </p><p>
              The number of nonunique columns in the index.
            </p></li><li class="listitem"><p>
              <code class="literal">subpart_exists</code>
            </p><p>
              Whether the index indexes only part of a column.
            </p></li><li class="listitem"><p>
              <code class="literal">index_columns</code>
            </p><p>
              The name of the columns in the index.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-table-lock-waits"></a>26.4.3.28 The schema_table_lock_waits and x$schema_table_lock_waits Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464657472"></a><a class="indexterm" name="idm139899464656016"></a><a class="indexterm" name="idm139899464654512"></a><a class="indexterm" name="idm139899464653008"></a><p>
          These views display which sessions are blocked waiting on
          metadata locks, and what is blocking them.
        </p><p>
          The column descriptions here are brief. For additional
          information, see the description of the Performance Schema
          <a class="link" href="performance-schema.html#metadata-locks-table" title="25.11.12.3 The metadata_locks Table"><code class="literal">metadata_locks</code></a> table at
          <a class="xref" href="performance-schema.html#metadata-locks-table" title="25.11.12.3 The metadata_locks Table">Section 25.11.12.3, “The metadata_locks Table”</a>.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-schema-table-lock-waits" title="26.4.3.28 The schema_table_lock_waits and x$schema_table_lock_waits Views"><code class="literal">schema_table_lock_waits</code></a> and
          <a class="link" href="sys-schema.html#sys-schema-table-lock-waits" title="26.4.3.28 The schema_table_lock_waits and x$schema_table_lock_waits Views"><code class="literal">x$schema_table_lock_waits</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">object_schema</code>
            </p><p>
              The schema containing the object to be locked.
            </p></li><li class="listitem"><p>
              <code class="literal">object_name</code>
            </p><p>
              The name of the instrumented object.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_thread_id</code>
            </p><p>
              The thread ID of the thread that is waiting for the lock.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_pid</code>
            </p><p>
              The processlist ID of the thread that is waiting for the
              lock.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_account</code>
            </p><p>
              The account associated with the session that is waiting
              for the lock.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_lock_type</code>
            </p><p>
              The type of the waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_lock_duration</code>
            </p><p>
              How long the waiting lock has been waiting.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_query</code>
            </p><p>
              The statement that is waiting for the lock.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_query_secs</code>
            </p><p>
              How long the statement has been waiting, in seconds.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_query_rows_affected</code>
            </p><p>
              The number of rows affected by the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">waiting_query_rows_examined</code>
            </p><p>
              The number of rows read from storage engines by the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_thread_id</code>
            </p><p>
              The thread ID of the thread that is blocking the waiting
              lock.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_pid</code>
            </p><p>
              The processlist ID of the thread that is blocking the
              waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_account</code>
            </p><p>
              The account associated with the thread that is blocking
              the waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_lock_type</code>
            </p><p>
              The type of lock that is blocking the waiting lock.
            </p></li><li class="listitem"><p>
              <code class="literal">blocking_lock_duration</code>
            </p><p>
              How long the blocking lock has been held.
            </p></li><li class="listitem"><p>
              <code class="literal">sql_kill_blocking_query</code>
            </p><p>
              The <a class="link" href="sql-syntax.html#kill" title="13.7.7.4 KILL Syntax"><code class="literal">KILL</code></a> statement to
              execute to kill the blocking statement.
            </p></li><li class="listitem"><p>
              <code class="literal">sql_kill_blocking_connection</code>
            </p><p>
              The <a class="link" href="sql-syntax.html#kill" title="13.7.7.4 KILL Syntax"><code class="literal">KILL</code></a> statement to
              execute to kill the session running the blocking
              statement.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-table-statistics"></a>26.4.3.29 The schema_table_statistics and x$schema_table_statistics Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464606288"></a><a class="indexterm" name="idm139899464604832"></a><a class="indexterm" name="idm139899464603328"></a><a class="indexterm" name="idm139899464601824"></a><p>
          These views summarize table statistics. By default, rows are
          sorted by descending total wait time (tables with most
          contention first).
        </p><p>
          These views user a helper view,
          <code class="literal">x$ps_schema_table_statistics_io</code>.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-schema-table-statistics" title="26.4.3.29 The schema_table_statistics and x$schema_table_statistics Views"><code class="literal">schema_table_statistics</code></a> and
          <a class="link" href="sys-schema.html#sys-schema-table-statistics" title="26.4.3.29 The schema_table_statistics and x$schema_table_statistics Views"><code class="literal">x$schema_table_statistics</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">table_schema</code>
            </p><p>
              The schema that contains the table.
            </p></li><li class="listitem"><p>
              <code class="literal">table_name</code>
            </p><p>
              The table name.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed I/O events for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_fetched</code>
            </p><p>
              The total number of rows read from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">fetch_latency</code>
            </p><p>
              The total wait time of timed read I/O events for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_inserted</code>
            </p><p>
              The total number of rows inserted into the table.
            </p></li><li class="listitem"><p>
              <code class="literal">insert_latency</code>
            </p><p>
              The total wait time of timed insert I/O events for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_updated</code>
            </p><p>
              The total number of rows updated in the table.
            </p></li><li class="listitem"><p>
              <code class="literal">update_latency</code>
            </p><p>
              The total wait time of timed update I/O events for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_deleted</code>
            </p><p>
              The total number of rows deleted from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">delete_latency</code>
            </p><p>
              The total wait time of timed delete I/O events for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_read_requests</code>
            </p><p>
              The total number of read requests for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_read</code>
            </p><p>
              The total number of bytes read from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_read_latency</code>
            </p><p>
              The total wait time of reads from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_write_requests</code>
            </p><p>
              The total number of write requests for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_write</code>
            </p><p>
              The total number of bytes written to the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_write_latency</code>
            </p><p>
              The total wait time of writes to the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_misc_requests</code>
            </p><p>
              The total number of miscellaneous I/O requests for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_misc_latency</code>
            </p><p>
              The total wait time of miscellaneous I/O requests for the
              table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-table-statistics-with-buffer"></a>26.4.3.30 The schema_table_statistics_with_buffer and
x$schema_table_statistics_with_buffer Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464556960"></a><a class="indexterm" name="idm139899464555440"></a><a class="indexterm" name="idm139899464553920"></a><a class="indexterm" name="idm139899464552400"></a><p>
          These views summarize table statistics, including
          <code class="literal">InnoDB</code> buffer pool statistics. By default,
          rows are sorted by descending total wait time (tables with
          most contention first).
        </p><p>
          These views user a helper view,
          <code class="literal">x$ps_schema_table_statistics_io</code>.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-schema-table-statistics-with-buffer" title="26.4.3.30 The schema_table_statistics_with_buffer and x$schema_table_statistics_with_buffer Views"><code class="literal">schema_table_statistics_with_buffer</code></a>
          and
          <a class="link" href="sys-schema.html#sys-schema-table-statistics-with-buffer" title="26.4.3.30 The schema_table_statistics_with_buffer and x$schema_table_statistics_with_buffer Views"><code class="literal">x$schema_table_statistics_with_buffer</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">table_schema</code>
            </p><p>
              The schema that contains the table.
            </p></li><li class="listitem"><p>
              <code class="literal">table_name</code>
            </p><p>
              The table name.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_fetched</code>
            </p><p>
              The total number of rows read from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">fetch_latency</code>
            </p><p>
              The total wait time of timed read I/O events for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_inserted</code>
            </p><p>
              The total number of rows inserted into the table.
            </p></li><li class="listitem"><p>
              <code class="literal">insert_latency</code>
            </p><p>
              The total wait time of timed insert I/O events for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_updated</code>
            </p><p>
              The total number of rows updated in the table.
            </p></li><li class="listitem"><p>
              <code class="literal">update_latency</code>
            </p><p>
              The total wait time of timed update I/O events for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_deleted</code>
            </p><p>
              The total number of rows deleted from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">delete_latency</code>
            </p><p>
              The total wait time of timed delete I/O events for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_read_requests</code>
            </p><p>
              The total number of read requests for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_read</code>
            </p><p>
              The total number of bytes read from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_read_latency</code>
            </p><p>
              The total wait time of reads from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_write_requests</code>
            </p><p>
              The total number of write requests for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_write</code>
            </p><p>
              The total number of bytes written to the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_write_latency</code>
            </p><p>
              The total wait time of writes to the table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_misc_requests</code>
            </p><p>
              The total number of miscellaneous I/O requests for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">io_misc_latency</code>
            </p><p>
              The total wait time of miscellaneous I/O requests for the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">innodb_buffer_allocated</code>
            </p><p>
              The total number of <code class="literal">InnoDB</code> buffer bytes
              allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">innodb_buffer_data</code>
            </p><p>
              The total number of <code class="literal">InnoDB</code> data bytes
              allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">innodb_buffer_free</code>
            </p><p>
              The total number of <code class="literal">InnoDB</code> nondata
              bytes allocated for the table
              (<code class="literal">innodb_buffer_allocated</code> −
              <code class="literal">innodb_buffer_data</code>).
            </p></li><li class="listitem"><p>
              <code class="literal">innodb_buffer_pages</code>
            </p><p>
              The total number of <code class="literal">InnoDB</code> pages
              allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">innodb_buffer_pages_hashed</code>
            </p><p>
              The total number of <code class="literal">InnoDB</code> hashed pages
              allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">innodb_buffer_pages_old</code>
            </p><p>
              The total number of <code class="literal">InnoDB</code> old pages
              allocated for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">innodb_buffer_rows_cached</code>
            </p><p>
              The total number of <code class="literal">InnoDB</code> cached rows
              for the table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-tables-with-full-table-scans"></a>26.4.3.31 The schema_tables_with_full_table_scans and
x$schema_tables_with_full_table_scans Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464488720"></a><a class="indexterm" name="idm139899464487200"></a><a class="indexterm" name="idm139899464485680"></a><a class="indexterm" name="idm139899464484160"></a><p>
          These views display which tables are being accessed with full
          table scans. By default, rows are sorted by descending rows
          scanned.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-schema-tables-with-full-table-scans" title="26.4.3.31 The schema_tables_with_full_table_scans and x$schema_tables_with_full_table_scans Views"><code class="literal">schema_tables_with_full_table_scans</code></a>
          and
          <a class="link" href="sys-schema.html#sys-schema-tables-with-full-table-scans" title="26.4.3.31 The schema_tables_with_full_table_scans and x$schema_tables_with_full_table_scans Views"><code class="literal">x$schema_tables_with_full_table_scans</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">object_schema</code>
            </p><p>
              The schema name.
            </p></li><li class="listitem"><p>
              <code class="literal">object_name</code>
            </p><p>
              The table name.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_full_scanned</code>
            </p><p>
              The total number of rows scanned by full scans of the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">latency</code>
            </p><p>
              The total wait time of full scans of the table.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-schema-unused-indexes"></a>26.4.3.32 The schema_unused_indexes View</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464469712"></a><a class="indexterm" name="idm139899464468208"></a><p>
          These views display indexes for which there are no events,
          which indicates that they are not being used. By default, rows
          are sorted by schema and table.
        </p><p>
          This view is most useful when the server has been up and
          processing long enough that its workload is representative.
          Otherwise, presence of an index in this view may not be
          meaningful.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-schema-unused-indexes" title="26.4.3.32 The schema_unused_indexes View"><code class="literal">schema_unused_indexes</code></a> view
          has these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">object_schema</code>
            </p><p>
              The schema name.
            </p></li><li class="listitem"><p>
              <code class="literal">object_name</code>
            </p><p>
              The table name.
            </p></li><li class="listitem"><p>
              <code class="literal">index_name</code>
            </p><p>
              The unused index name.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-session"></a>26.4.3.33 The session and x$session Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464456368"></a><a class="indexterm" name="idm139899464454912"></a><a class="indexterm" name="idm139899464453424"></a><a class="indexterm" name="idm139899464451936"></a><p>
          These views are similar to
          <a class="link" href="sys-schema.html#sys-processlist" title="26.4.3.22 The processlist and x$processlist Views"><code class="literal">processlist</code></a> and
          <a class="link" href="sys-schema.html#sys-processlist" title="26.4.3.22 The processlist and x$processlist Views"><code class="literal">x$processlist</code></a>, but they filter
          out background processes to display only user sessions. For
          descriptions of the columns, see
          <a class="xref" href="sys-schema.html#sys-processlist" title="26.4.3.22 The processlist and x$processlist Views">Section 26.4.3.22, “The processlist and x$processlist Views”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-session-ssl-status"></a>26.4.3.34 The session_ssl_status View</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464445456"></a><a class="indexterm" name="idm139899464444000"></a><p>
          For each connection, this view displays the SSL version,
          cipher, and count of reused SSL sessions.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-session-ssl-status" title="26.4.3.34 The session_ssl_status View"><code class="literal">session_ssl_status</code></a> view has
          these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">thread_id</code>
            </p><p>
              The thread ID for the connection.
            </p></li><li class="listitem"><p>
              <code class="literal">ssl_version</code>
            </p><p>
              The version of SSL used for the connection.
            </p></li><li class="listitem"><p>
              <code class="literal">ssl_cipher</code>
            </p><p>
              The SSL cipher used for the connection.
            </p></li><li class="listitem"><p>
              <code class="literal">ssl_sessions_reused</code>
            </p><p>
              The number of reused SSL sessions for the connection.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-statement-analysis"></a>26.4.3.35 The statement_analysis and x$statement_analysis Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464430928"></a><a class="indexterm" name="idm139899464429472"></a><a class="indexterm" name="idm139899464427984"></a><a class="indexterm" name="idm139899464426480"></a><p>
          These views list normalized statements with aggregated
          statistics. The content mimics the MySQL Enterprise Monitor
          Query Analysis view. By default, rows are sorted by descending
          total latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-statement-analysis" title="26.4.3.35 The statement_analysis and x$statement_analysis Views"><code class="literal">statement_analysis</code></a> and
          <a class="link" href="sys-schema.html#sys-statement-analysis" title="26.4.3.35 The statement_analysis and x$statement_analysis Views"><code class="literal">x$statement_analysis</code></a> views have
          these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">query</code>
            </p><p>
              The normalized statement string.
            </p></li><li class="listitem"><p>
              <code class="literal">db</code>
            </p><p>
              The default database for the statement, or
              <code class="literal">NULL</code> if there is none.
            </p></li><li class="listitem"><p>
              <code class="literal">full_scan</code>
            </p><p>
              The total number of full table scans performed by
              occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">exec_count</code>
            </p><p>
              The total number of times the statement has executed.
            </p></li><li class="listitem"><p>
              <code class="literal">err_count</code>
            </p><p>
              The total number of errors produced by occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">warn_count</code>
            </p><p>
              The total number of warnings produced by occurrences of
              the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">lock_latency</code>
            </p><p>
              The total time waiting for locks by timed occurrences of
              the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent</code>
            </p><p>
              The total number of rows returned by occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent_avg</code>
            </p><p>
              The average number of rows returned per occurrence of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined</code>
            </p><p>
              The total number of rows read from storage engines by
              occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined_avg</code>
            </p><p>
              The average number of rows read from storage engines per
              occurrence of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_affected</code>
            </p><p>
              The total number of rows affected by occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_affected_avg</code>
            </p><p>
              The average number of rows affected per occurrence of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">tmp_tables</code>
            </p><p>
              The total number of internal in-memory temporary tables
              created by occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">tmp_disk_tables</code>
            </p><p>
              The total number of internal on-disk temporary tables
              created by occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sorted</code>
            </p><p>
              The total number of rows sorted by occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">sort_merge_passes</code>
            </p><p>
              The total number of sort merge passes by occurrences of
              the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">digest</code>
            </p><p>
              The statement digest.
            </p></li><li class="listitem"><p>
              <code class="literal">first_seen</code>
            </p><p>
              The time at which the statement was first seen.
            </p></li><li class="listitem"><p>
              <code class="literal">last_seen</code>
            </p><p>
              The time at which the statement was most recently seen.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-statements-with-errors-or-warnings"></a>26.4.3.36 The statements_with_errors_or_warnings and
x$statements_with_errors_or_warnings Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464373856"></a><a class="indexterm" name="idm139899464372400"></a><a class="indexterm" name="idm139899464370896"></a><a class="indexterm" name="idm139899464369376"></a><p>
          These views display normalized statements that have produced
          errors or warnings. By default, rows are sorted by descending
          error and warning counts.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-statements-with-errors-or-warnings" title="26.4.3.36 The statements_with_errors_or_warnings and x$statements_with_errors_or_warnings Views"><code class="literal">statements_with_errors_or_warnings</code></a>
          and
          <a class="link" href="sys-schema.html#sys-statements-with-errors-or-warnings" title="26.4.3.36 The statements_with_errors_or_warnings and x$statements_with_errors_or_warnings Views"><code class="literal">x$statements_with_errors_or_warnings</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">query</code>
            </p><p>
              The normalized statement string.
            </p></li><li class="listitem"><p>
              <code class="literal">db</code>
            </p><p>
              The default database for the statement, or
              <code class="literal">NULL</code> if there is none.
            </p></li><li class="listitem"><p>
              <code class="literal">exec_count</code>
            </p><p>
              The total number of times the statement has executed.
            </p></li><li class="listitem"><p>
              <code class="literal">errors</code>
            </p><p>
              The total number of errors produced by occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">error_pct</code>
            </p><p>
              The percentage of statement occurrences that produced
              errors.
            </p></li><li class="listitem"><p>
              <code class="literal">warnings</code>
            </p><p>
              The total number of warnings produced by occurrences of
              the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">warning_pct</code>
            </p><p>
              The percentage of statement occurrences that produced
              warnings.
            </p></li><li class="listitem"><p>
              <code class="literal">first_seen</code>
            </p><p>
              The time at which the statement was first seen.
            </p></li><li class="listitem"><p>
              <code class="literal">last_seen</code>
            </p><p>
              The time at which the statement was most recently seen.
            </p></li><li class="listitem"><p>
              <code class="literal">digest</code>
            </p><p>
              The statement digest.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-statements-with-full-table-scans"></a>26.4.3.37 The statements_with_full_table_scans and
x$statements_with_full_table_scans Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464342320"></a><a class="indexterm" name="idm139899464340864"></a><a class="indexterm" name="idm139899464339360"></a><a class="indexterm" name="idm139899464337856"></a><p>
          These views display normalized statements that have done full
          table scans. By default, rows are sorted by descending
          percentage of time a full scan was done and descending total
          latency.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-statements-with-full-table-scans" title="26.4.3.37 The statements_with_full_table_scans and x$statements_with_full_table_scans Views"><code class="literal">statements_with_full_table_scans</code></a>
          and
          <a class="link" href="sys-schema.html#sys-statements-with-full-table-scans" title="26.4.3.37 The statements_with_full_table_scans and x$statements_with_full_table_scans Views"><code class="literal">x$statements_with_full_table_scans</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">query</code>
            </p><p>
              The normalized statement string.
            </p></li><li class="listitem"><p>
              <code class="literal">db</code>
            </p><p>
              The default database for the statement, or
              <code class="literal">NULL</code> if there is none.
            </p></li><li class="listitem"><p>
              <code class="literal">exec_count</code>
            </p><p>
              The total number of times the statement has executed.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed statement events for the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">no_index_used_count</code>
            </p><p>
              The total number of times no index was used to scan the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">no_good_index_used_count</code>
            </p><p>
              The total number of times no good index was used to scan
              the table.
            </p></li><li class="listitem"><p>
              <code class="literal">no_index_used_pct</code>
            </p><p>
              The percentage of the time no index was used to scan the
              table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent</code>
            </p><p>
              The total number of rows returned from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined</code>
            </p><p>
              The total number of rows read from the storage engine for
              the table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent_avg</code>
            </p><p>
              The average number of rows returned from the table.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined_avg</code>
            </p><p>
              The average number of rows read from the storage engine
              for the table.
            </p></li><li class="listitem"><p>
              <code class="literal">first_seen</code>
            </p><p>
              The time at which the statement was first seen.
            </p></li><li class="listitem"><p>
              <code class="literal">last_seen</code>
            </p><p>
              The time at which the statement was most recently seen.
            </p></li><li class="listitem"><p>
              <code class="literal">digest</code>
            </p><p>
              The statement digest.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-statements-with-runtimes-in-95th-percentile"></a>26.4.3.38 The statements_with_runtimes_in_95th_percentile and
x$statements_with_runtimes_in_95th_percentile Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464302864"></a><a class="indexterm" name="idm139899464301408"></a><a class="indexterm" name="idm139899464299888"></a><a class="indexterm" name="idm139899464298368"></a><p>
          These views list statements with runtimes in the 95th
          percentile. By default, rows are sorted by descending average
          latency.
        </p><p>
          Both views use two helper views,
          <code class="literal">x$ps_digest_avg_latency_distribution</code> and
          <code class="literal">x$ps_digest_95th_percentile_by_avg_us</code>.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile" title="26.4.3.38 The statements_with_runtimes_in_95th_percentile and x$statements_with_runtimes_in_95th_percentile Views"><code class="literal">statements_with_runtimes_in_95th_percentile</code></a>
          and
          <a class="link" href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile" title="26.4.3.38 The statements_with_runtimes_in_95th_percentile and x$statements_with_runtimes_in_95th_percentile Views"><code class="literal">x$statements_with_runtimes_in_95th_percentile</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">query</code>
            </p><p>
              The normalized statement string.
            </p></li><li class="listitem"><p>
              <code class="literal">db</code>
            </p><p>
              The default database for the statement, or
              <code class="literal">NULL</code> if there is none.
            </p></li><li class="listitem"><p>
              <code class="literal">full_scan</code>
            </p><p>
              The total number of full table scans performed by
              occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">exec_count</code>
            </p><p>
              The total number of times the statement has executed.
            </p></li><li class="listitem"><p>
              <code class="literal">err_count</code>
            </p><p>
              The total number of errors produced by occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">warn_count</code>
            </p><p>
              The total number of warnings produced by occurrences of
              the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent</code>
            </p><p>
              The total number of rows returned by occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent_avg</code>
            </p><p>
              The average number of rows returned per occurrence of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined</code>
            </p><p>
              The total number of rows read from storage engines by
              occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined_avg</code>
            </p><p>
              The average number of rows read from storage engines per
              occurrence of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">first_seen</code>
            </p><p>
              The time at which the statement was first seen.
            </p></li><li class="listitem"><p>
              <code class="literal">last_seen</code>
            </p><p>
              The time at which the statement was most recently seen.
            </p></li><li class="listitem"><p>
              <code class="literal">digest</code>
            </p><p>
              The statement digest.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-statements-with-sorting"></a>26.4.3.39 The statements_with_sorting and x$statements_with_sorting Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464257536"></a><a class="indexterm" name="idm139899464256080"></a><a class="indexterm" name="idm139899464254576"></a><a class="indexterm" name="idm139899464253072"></a><p>
          These views list normalized statements that have performed
          sorts. By default, rows are sorted by descending total
          latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-statements-with-sorting" title="26.4.3.39 The statements_with_sorting and x$statements_with_sorting Views"><code class="literal">statements_with_sorting</code></a> and
          <a class="link" href="sys-schema.html#sys-statements-with-sorting" title="26.4.3.39 The statements_with_sorting and x$statements_with_sorting Views"><code class="literal">x$statements_with_sorting</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">query</code>
            </p><p>
              The normalized statement string.
            </p></li><li class="listitem"><p>
              <code class="literal">db</code>
            </p><p>
              The default database for the statement, or
              <code class="literal">NULL</code> if there is none.
            </p></li><li class="listitem"><p>
              <code class="literal">exec_count</code>
            </p><p>
              The total number of times the statement has executed.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">sort_merge_passes</code>
            </p><p>
              The total number of sort merge passes by occurrences of
              the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_sort_merges</code>
            </p><p>
              The average number of sort merge passes per occurrence of
              the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">sorts_using_scans</code>
            </p><p>
              The total number of sorts using table scans by occurrences
              of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">sort_using_range</code>
            </p><p>
              The total number of sorts using range accesses by
              occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sorted</code>
            </p><p>
              The total number of rows sorted by occurrences of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_rows_sorted</code>
            </p><p>
              The average number of rows sorted per occurrence of the
              statement.
            </p></li><li class="listitem"><p>
              <code class="literal">first_seen</code>
            </p><p>
              The time at which the statement was first seen.
            </p></li><li class="listitem"><p>
              <code class="literal">last_seen</code>
            </p><p>
              The time at which the statement was most recently seen.
            </p></li><li class="listitem"><p>
              <code class="literal">digest</code>
            </p><p>
              The statement digest.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-statements-with-temp-tables"></a>26.4.3.40 The statements_with_temp_tables and x$statements_with_temp_tables Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464220240"></a><a class="indexterm" name="idm139899464218784"></a><a class="indexterm" name="idm139899464217280"></a><a class="indexterm" name="idm139899464215776"></a><p>
          These views list normalized statements that have used
          temporary tables. By default, rows are sorted by descending
          number of on-disk temporary tables used and descending number
          of in-memory temporary tables used.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-statements-with-temp-tables" title="26.4.3.40 The statements_with_temp_tables and x$statements_with_temp_tables Views"><code class="literal">statements_with_temp_tables</code></a>
          and
          <a class="link" href="sys-schema.html#sys-statements-with-temp-tables" title="26.4.3.40 The statements_with_temp_tables and x$statements_with_temp_tables Views"><code class="literal">x$statements_with_temp_tables</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">query</code>
            </p><p>
              The normalized statement string.
            </p></li><li class="listitem"><p>
              <code class="literal">db</code>
            </p><p>
              The default database for the statement, or
              <code class="literal">NULL</code> if there is none.
            </p></li><li class="listitem"><p>
              <code class="literal">exec_count</code>
            </p><p>
              The total number of times the statement has executed.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">memory_tmp_tables</code>
            </p><p>
              The total number of internal in-memory temporary tables
              created by occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">disk_tmp_tables</code>
            </p><p>
              The total number of internal on-disk temporary tables
              created by occurrences of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_tmp_tables_per_query</code>
            </p><p>
              The average number of internal temporary tables created
              per occurrence of the statement.
            </p></li><li class="listitem"><p>
              <code class="literal">tmp_tables_to_disk_pct</code>
            </p><p>
              The percentage of internal in-memory temporary tables that
              were converted to on-disk tables.
            </p></li><li class="listitem"><p>
              <code class="literal">first_seen</code>
            </p><p>
              The time at which the statement was first seen.
            </p></li><li class="listitem"><p>
              <code class="literal">last_seen</code>
            </p><p>
              The time at which the statement was most recently seen.
            </p></li><li class="listitem"><p>
              <code class="literal">digest</code>
            </p><p>
              The statement digest.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-user-summary"></a>26.4.3.41 The user_summary and x$user_summary Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464186720"></a><a class="indexterm" name="idm139899464185264"></a><a class="indexterm" name="idm139899464183776"></a><a class="indexterm" name="idm139899464182288"></a><p>
          These views summarize statement activity, file I/O, and
          connections, grouped by user. By default, rows are sorted by
          descending total latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-user-summary" title="26.4.3.41 The user_summary and x$user_summary Views"><code class="literal">user_summary</code></a> and
          <a class="link" href="sys-schema.html#sys-user-summary" title="26.4.3.41 The user_summary and x$user_summary Views"><code class="literal">x$user_summary</code></a> views have these
          columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The client user name. Rows for which the
              <code class="literal">USER</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">statements</code>
            </p><p>
              The total number of statements for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">statement_latency</code>
            </p><p>
              The total wait time of timed statements for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">statement_avg_latency</code>
            </p><p>
              The average wait time per timed statement for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">table_scans</code>
            </p><p>
              The total number of table scans for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">file_ios</code>
            </p><p>
              The total number of file I/O events for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">file_io_latency</code>
            </p><p>
              The total wait time of timed file I/O events for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">current_connections</code>
            </p><p>
              The current number of connections for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">total_connections</code>
            </p><p>
              The total number of connections for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">unique_hosts</code>
            </p><p>
              The number of distinct hosts from which connections for
              the user have originated.
            </p></li><li class="listitem"><p>
              <code class="literal">current_memory</code>
            </p><p>
              The current amount of allocated memory for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">total_memory_allocated</code>
            </p><p>
              The total amount of allocated memory for the user.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-user-summary-by-file-io"></a>26.4.3.42 The user_summary_by_file_io and x$user_summary_by_file_io Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464150000"></a><a class="indexterm" name="idm139899464148544"></a><a class="indexterm" name="idm139899464147040"></a><a class="indexterm" name="idm139899464145536"></a><p>
          These views summarize file I/O, grouped by user. By default,
          rows are sorted by descending total file I/O latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-user-summary-by-file-io" title="26.4.3.42 The user_summary_by_file_io and x$user_summary_by_file_io Views"><code class="literal">user_summary_by_file_io</code></a> and
          <a class="link" href="sys-schema.html#sys-user-summary-by-file-io" title="26.4.3.42 The user_summary_by_file_io and x$user_summary_by_file_io Views"><code class="literal">x$user_summary_by_file_io</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The client user name. Rows for which the
              <code class="literal">USER</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">ios</code>
            </p><p>
              The total number of file I/O events for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">io_latency</code>
            </p><p>
              The total wait time of timed file I/O events for the user.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-user-summary-by-file-io-type"></a>26.4.3.43 The user_summary_by_file_io_type and x$user_summary_by_file_io_type
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464130672"></a><a class="indexterm" name="idm139899464129216"></a><a class="indexterm" name="idm139899464127712"></a><a class="indexterm" name="idm139899464126208"></a><p>
          These views summarize file I/O, grouped by user and event
          type. By default, rows are sorted by user and descending total
          latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-user-summary-by-file-io-type" title="26.4.3.43 The user_summary_by_file_io_type and x$user_summary_by_file_io_type Views"><code class="literal">user_summary_by_file_io_type</code></a>
          and
          <a class="link" href="sys-schema.html#sys-user-summary-by-file-io-type" title="26.4.3.43 The user_summary_by_file_io_type and x$user_summary_by_file_io_type Views"><code class="literal">x$user_summary_by_file_io_type</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The client user name. Rows for which the
              <code class="literal">USER</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">event_name</code>
            </p><p>
              The file I/O event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the file I/O event for
              the user.
            </p></li><li class="listitem"><p>
              <code class="literal">latency</code>
            </p><p>
              The total wait time of timed occurrences of the file I/O
              event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              file I/O event for the user.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-user-summary-by-stages"></a>26.4.3.44 The user_summary_by_stages and x$user_summary_by_stages Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464107312"></a><a class="indexterm" name="idm139899464105856"></a><a class="indexterm" name="idm139899464104352"></a><a class="indexterm" name="idm139899464102848"></a><p>
          These views summarize stages, grouped by user. By default,
          rows are sorted by user and descending total stage latency.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-user-summary-by-stages" title="26.4.3.44 The user_summary_by_stages and x$user_summary_by_stages Views"><code class="literal">user_summary_by_stages</code></a> and
          <a class="link" href="sys-schema.html#sys-user-summary-by-stages" title="26.4.3.44 The user_summary_by_stages and x$user_summary_by_stages Views"><code class="literal">x$user_summary_by_stages</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The client user name. Rows for which the
              <code class="literal">USER</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">event_name</code>
            </p><p>
              The stage event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the stage event for the
              user.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the stage
              event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the stage
              event for the user.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-user-summary-by-statement-latency"></a>26.4.3.45 The user_summary_by_statement_latency and
x$user_summary_by_statement_latency Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464084000"></a><a class="indexterm" name="idm139899464082544"></a><a class="indexterm" name="idm139899464081040"></a><a class="indexterm" name="idm139899464079520"></a><p>
          These views summarize overall statement statistics, grouped by
          user. By default, rows are sorted by descending total latency.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-user-summary-by-statement-latency" title="26.4.3.45 The user_summary_by_statement_latency and x$user_summary_by_statement_latency Views"><code class="literal">user_summary_by_statement_latency</code></a>
          and
          <a class="link" href="sys-schema.html#sys-user-summary-by-statement-latency" title="26.4.3.45 The user_summary_by_statement_latency and x$user_summary_by_statement_latency Views"><code class="literal">x$user_summary_by_statement_latency</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The client user name. Rows for which the
              <code class="literal">USER</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of statements for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed statements for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed statements for the
              user.
            </p></li><li class="listitem"><p>
              <code class="literal">lock_latency</code>
            </p><p>
              The total time waiting for locks by timed statements for
              the user.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent</code>
            </p><p>
              The total number of rows returned by statements for the
              user.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined</code>
            </p><p>
              The total number of rows read from storage engines by
              statements for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_affected</code>
            </p><p>
              The total number of rows affected by statements for the
              user.
            </p></li><li class="listitem"><p>
              <code class="literal">full_scans</code>
            </p><p>
              The total number of full table scans by statements for the
              user.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-user-summary-by-statement-type"></a>26.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464052752"></a><a class="indexterm" name="idm139899464051280"></a><a class="indexterm" name="idm139899464049776"></a><a class="indexterm" name="idm139899464048272"></a><p>
          These views summarize informaion about statements executed,
          grouped by user and statement type. By default, rows are
          sorted by user and descending total latency.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-user-summary-by-statement-type" title="26.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type Views"><code class="literal">user_summary_by_statement_type</code></a>
          and
          <a class="link" href="sys-schema.html#sys-user-summary-by-statement-type" title="26.4.3.46 The user_summary_by_statement_type and x$user_summary_by_statement_type Views"><code class="literal">x$user_summary_by_statement_type</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The client user name. Rows for which the
              <code class="literal">USER</code> column in the underlying
              Performance Schema table is <code class="literal">NULL</code> are
              assumed to be for background threads and are reported with
              a host name of <code class="literal">background</code>.
            </p></li><li class="listitem"><p>
              <code class="literal">statement</code>
            </p><p>
              The final component of the statement event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the statement event for
              the user.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the statement
              event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              statement event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">lock_latency</code>
            </p><p>
              The total time waiting for locks by timed occurrences of
              the statement event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_sent</code>
            </p><p>
              The total number of rows returned by occurrences of the
              statement event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_examined</code>
            </p><p>
              The total number of rows read from storage engines by
              occurrences of the statement event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">rows_affected</code>
            </p><p>
              The total number of rows affected by occurrences of the
              statement event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">full_scans</code>
            </p><p>
              The total number of full table scans by occurrences of the
              statement event for the user.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-version"></a>26.4.3.47 The version View</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899464019488"></a><a class="indexterm" name="idm139899464018000"></a><p>
          This view provides the current
          <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema and MySQL server
          versions.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-version" title="26.4.3.47 The version View"><code class="literal">version</code></a> view has these
          columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">sys_version</code>
            </p><p>
              The <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema version.
            </p></li><li class="listitem"><p>
              <code class="literal">mysql_version</code>
            </p><p>
              The MySQL server version.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-wait-classes-global-by-avg-latency"></a>26.4.3.48 The wait_classes_global_by_avg_latency and
x$wait_classes_global_by_avg_latency Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899464006384"></a><a class="indexterm" name="idm139899464004928"></a><a class="indexterm" name="idm139899464003424"></a><a class="indexterm" name="idm139899464001904"></a><p>
          These views summarize wait class average latencies, grouped by
          event class. By default, rows are sorted by descending average
          latency. Idle events are ignored.
        </p><p>
          An event class is determined by stripping from the event name
          everything after the first three components. For example, the
          class for <code class="literal">wait/io/file/sql/slow_log</code> is
          <code class="literal">wait/io/file</code>.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-wait-classes-global-by-avg-latency" title="26.4.3.48 The wait_classes_global_by_avg_latency and x$wait_classes_global_by_avg_latency Views"><code class="literal">wait_classes_global_by_avg_latency</code></a>
          and
          <a class="link" href="sys-schema.html#sys-wait-classes-global-by-avg-latency" title="26.4.3.48 The wait_classes_global_by_avg_latency and x$wait_classes_global_by_avg_latency Views"><code class="literal">x$wait_classes_global_by_avg_latency</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">event_class</code>
            </p><p>
              The event class.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of events in the class.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of events in the
              class.
            </p></li><li class="listitem"><p>
              <code class="literal">min_latency</code>
            </p><p>
              The minimum single wait time of timed occurrences of
              events in the class.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of events in
              the class.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of
              events in the class.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-wait-classes-global-by-latency"></a>26.4.3.49 The wait_classes_global_by_latency and x$wait_classes_global_by_latency
Views</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899463981264"></a><a class="indexterm" name="idm139899463979808"></a><a class="indexterm" name="idm139899463978304"></a><a class="indexterm" name="idm139899463976800"></a><p>
          These views summarize wait class total latencies, grouped by
          event class. By default, rows are sorted by descending total
          latency. Idle events are ignored.
        </p><p>
          An event class is determined by stripping from the event name
          everything after the first three components. For example, the
          class for <code class="literal">wait/io/file/sql/slow_log</code> is
          <code class="literal">wait/io/file</code>.
        </p><p>
          The
          <a class="link" href="sys-schema.html#sys-wait-classes-global-by-latency" title="26.4.3.49 The wait_classes_global_by_latency and x$wait_classes_global_by_latency Views"><code class="literal">wait_classes_global_by_latency</code></a>
          and
          <a class="link" href="sys-schema.html#sys-wait-classes-global-by-latency" title="26.4.3.49 The wait_classes_global_by_latency and x$wait_classes_global_by_latency Views"><code class="literal">x$wait_classes_global_by_latency</code></a>
          views have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">event_class</code>
            </p><p>
              The event class.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of events in the class.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of events in the
              class.
            </p></li><li class="listitem"><p>
              <code class="literal">min_latency</code>
            </p><p>
              The minimum single wait time of timed occurrences of
              events in the class.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of events in
              the class.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of
              events in the class.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-waits-by-host-by-latency"></a>26.4.3.50 The waits_by_host_by_latency and x$waits_by_host_by_latency Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463956192"></a><a class="indexterm" name="idm139899463954736"></a><a class="indexterm" name="idm139899463953232"></a><a class="indexterm" name="idm139899463951728"></a><p>
          These views summarize wait events, grouped by host and event.
          By default, rows are sorted by host and descending total
          latency. Idle events are ignored.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-waits-by-host-by-latency" title="26.4.3.50 The waits_by_host_by_latency and x$waits_by_host_by_latency Views"><code class="literal">waits_by_host_by_latency</code></a> and
          <a class="link" href="sys-schema.html#sys-waits-by-host-by-latency" title="26.4.3.50 The waits_by_host_by_latency and x$waits_by_host_by_latency Views"><code class="literal">x$waits_by_host_by_latency</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">host</code>
            </p><p>
              The host from which the connection originated.
            </p></li><li class="listitem"><p>
              <code class="literal">event</code>
            </p><p>
              The event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the event for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the event for
              the host.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the event
              for the host.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              event for the host.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-waits-by-user-by-latency"></a>26.4.3.51 The waits_by_user_by_latency and x$waits_by_user_by_latency Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463933200"></a><a class="indexterm" name="idm139899463931744"></a><a class="indexterm" name="idm139899463930240"></a><a class="indexterm" name="idm139899463928736"></a><p>
          These views summarize wait events, grouped by user and event.
          By default, rows are sorted by user and descending total
          latency. Idle events are ignored.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-waits-by-user-by-latency" title="26.4.3.51 The waits_by_user_by_latency and x$waits_by_user_by_latency Views"><code class="literal">waits_by_user_by_latency</code></a> and
          <a class="link" href="sys-schema.html#sys-waits-by-user-by-latency" title="26.4.3.51 The waits_by_user_by_latency and x$waits_by_user_by_latency Views"><code class="literal">x$waits_by_user_by_latency</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">user</code>
            </p><p>
              The user associated with the connection.
            </p></li><li class="listitem"><p>
              <code class="literal">event</code>
            </p><p>
              The event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the event for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the event for
              the user.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the event
              for the user.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              event for the user.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-waits-global-by-latency"></a>26.4.3.52 The waits_global_by_latency and x$waits_global_by_latency Views</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463910224"></a><a class="indexterm" name="idm139899463908768"></a><a class="indexterm" name="idm139899463907264"></a><a class="indexterm" name="idm139899463905760"></a><p>
          These views summarize wait events, grouped by event. By
          default, rows are sorted by descending total latency. Idle
          events are ignored.
        </p><p>
          The <a class="link" href="sys-schema.html#sys-waits-global-by-latency" title="26.4.3.52 The waits_global_by_latency and x$waits_global_by_latency Views"><code class="literal">waits_global_by_latency</code></a> and
          <a class="link" href="sys-schema.html#sys-waits-global-by-latency" title="26.4.3.52 The waits_global_by_latency and x$waits_global_by_latency Views"><code class="literal">x$waits_global_by_latency</code></a> views
          have these columns:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">events</code>
            </p><p>
              The event name.
            </p></li><li class="listitem"><p>
              <code class="literal">total</code>
            </p><p>
              The total number of occurrences of the event.
            </p></li><li class="listitem"><p>
              <code class="literal">total_latency</code>
            </p><p>
              The total wait time of timed occurrences of the event.
            </p></li><li class="listitem"><p>
              <code class="literal">avg_latency</code>
            </p><p>
              The average wait time per timed occurrence of the event.
            </p></li><li class="listitem"><p>
              <code class="literal">max_latency</code>
            </p><p>
              The maximum single wait time of timed occurrences of the
              event.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="sys-schema-procedures"></a>26.4.4 sys Schema Stored Procedures</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="sys-schema.html#sys-create-synonym-db">26.4.4.1 The create_synonym_db() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-diagnostics">26.4.4.2 The diagnostics() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-execute-prepared-stmt">26.4.4.3 The execute_prepared_stmt() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-disable-background-threads">26.4.4.4 The ps_setup_disable_background_threads() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-disable-consumer">26.4.4.5 The ps_setup_disable_consumer() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-disable-instrument">26.4.4.6 The ps_setup_disable_instrument() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-disable-thread">26.4.4.7 The ps_setup_disable_thread() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-enable-background-threads">26.4.4.8 The ps_setup_enable_background_threads() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-enable-consumer">26.4.4.9 The ps_setup_enable_consumer() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-enable-instrument">26.4.4.10 The ps_setup_enable_instrument() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-enable-thread">26.4.4.11 The ps_setup_enable_thread() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-reload-saved">26.4.4.12 The ps_setup_reload_saved() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-reset-to-default">26.4.4.13 The ps_setup_reset_to_default() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-save">26.4.4.14 The ps_setup_save() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-show-disabled">26.4.4.15 The ps_setup_show_disabled() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-show-disabled-consumers">26.4.4.16 The ps_setup_show_disabled_consumers() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-show-disabled-instruments">26.4.4.17 The ps_setup_show_disabled_instruments() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-show-enabled">26.4.4.18 The ps_setup_show_enabled() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-show-enabled-consumers">26.4.4.19 The ps_setup_show_enabled_consumers() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-setup-show-enabled-instruments">26.4.4.20 The ps_setup_show_enabled_instruments() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-statement-avg-latency-histogram">26.4.4.21 The ps_statement_avg_latency_histogram() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-trace-statement-digest">26.4.4.22 The ps_trace_statement_digest() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-trace-thread">26.4.4.23 The ps_trace_thread() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-truncate-all-tables">26.4.4.24 The ps_truncate_all_tables() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-statement-performance-analyzer">26.4.4.25 The statement_performance_analyzer() Procedure</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-table-exists">26.4.4.26 The table_exists() Procedure</a></span></dt></dl>
</div>
<p>
        The following sections describe
        <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema stored procedures.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-create-synonym-db"></a>26.4.4.1 The create_synonym_db() Procedure</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899463886384"></a><a class="indexterm" name="idm139899463884912"></a><p>
          Given a schema name, this procedure creates a synonym schema
          containing views that refer to all the tables and views in the
          original schema. This can be used, for example, to create a
          shorter name by which to refer to a schema with a long name
          (such as <code class="literal">info</code> rather than
          <code class="literal">INFORMATION_SCHEMA</code>).
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-create-synonym-db-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_db_name VARCHAR(64)</code>: The name of
                the schema for which to create the synonym.
              </p></li><li class="listitem"><p>
                <code class="literal">in_synonym VARCHAR(64)</code>: The name to
                use for the synonym schema. This schema must not already
                exist.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-create-synonym-db-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SHOW DATABASES;</code></strong>
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| world              |
+--------------------+
mysql&gt; <strong class="userinput"><code>CALL create_synonym_db('INFORMATION_SCHEMA', 'info');</code></strong>
+---------------------------------------+
| summary                               |
+---------------------------------------+
| Created 63 views in the info database |
+---------------------------------------+
mysql&gt; <strong class="userinput"><code>SHOW DATABASES;</code></strong>
+--------------------+
| Database           |
+--------------------+
| information_schema |
| info               |
| mysql              |
| performance_schema |
| sys                |
| world              |
+--------------------+
mysql&gt; <strong class="userinput"><code>SHOW FULL TABLES FROM info;</code></strong>
+---------------------------------------+------------+
| Tables_in_info                        | Table_type |
+---------------------------------------+------------+
| character_sets                        | VIEW       |
| collation_character_set_applicability | VIEW       |
| collations                            | VIEW       |
| column_privileges                     | VIEW       |
| columns                               | VIEW       |
...
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-diagnostics"></a>26.4.4.2 The diagnostics() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899644736080"></a><a class="indexterm" name="idm139899644734624"></a><p>
          Creates a report of the current server status for diagnostic
          purposes.
        </p><p>
          This procedure requires the
          <a class="link" href="security.html#priv_system-variables-admin"><code class="literal">SYSTEM_VARIABLES_ADMIN</code></a> or
          <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege because it
          manipulates the session
          <a class="link" href="server-administration.html#sysvar_sql_log_bin"><code class="literal">sql_log_bin</code></a> system variable
          to disable binary logging during its execution.
        </p><p>
          Data collected for <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a>
          includes this information:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              Information from the <a class="link" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View"><code class="literal">metrics</code></a>
              view (see <a class="xref" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View">Section 26.4.3.21, “The metrics View”</a>)
            </p></li><li class="listitem"><p>
              Information from other relevant <code class="literal">sys</code>
              schema views, such as the one that detemines queries in
              the 95th percentile
            </p></li><li class="listitem"><p>
              Information from the <code class="literal">ndbinfo</code> schema, if
              the MySQL server is part of MySQL Cluster
            </p></li><li class="listitem"><p>
              Replication status (both master and slave)
</p></li></ul>
</div>
<p>
          Some of the sys schema views are calculated as initial
          (optional), overall, and delta values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              The initial view is the content of the view at the start
              of the <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a>
              procedure. This output is the same as the start values
              used for the delta view. The initial view is included if
              the <code class="literal">diagnostics.include_raw</code>
              configuration option is <code class="literal">ON</code>.
            </p></li><li class="listitem"><p>
              The overall view is the content of the view at the end of
              the <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a> procedure.
              This output is the same as the end values used for the
              delta view. The overall view is always included.
            </p></li><li class="listitem"><p>
              The delta view is the difference from the beginning to the
              end of procedure execution. The minimum and maximum values
              are the minimum and maximum values from the end view,
              respectively. They do not necessarily reflect the minimum
              and maximum values in the monitored period. Except for the
              <a class="link" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View"><code class="literal">metrics</code></a> view, the delta is
              calculated only between the first and last outputs.
</p></li></ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-diagnostics-parameters"></a>Parameters</h5>

</div>

</div>

</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_max_runtime INT UNSIGNED</code>: The
                maximum data collection time in seconds. Use
                <code class="literal">NULL</code> to collect data for the default
                of 60 seconds. Otherwise, use a value greater than 0.
              </p></li><li class="listitem"><p>
                <code class="literal">in_interval INT UNSIGNED</code>: The sleep
                time between data collections in seconds. Use
                <code class="literal">NULL</code> to sleep for the default of 30
                seconds. Otherwise, use a value greater than 0.
              </p></li><li class="listitem"><p>
                <code class="literal">in_auto_config ENUM('current', 'medium',
                'full')</code>: The Performance Schema configuration
                to use. Permitted values are:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                    <code class="literal">current</code>: Use the current
                    instrument and consumer settings.
                  </p></li><li class="listitem"><p>
                    <code class="literal">medium</code>: Enable some instruments
                    and consumers.
                  </p></li><li class="listitem"><p>
                    <code class="literal">full</code>: Enable all instruments and
                    consumers.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
                  The more instruments and consumers enabled, the more
                  impact on MySQL server performance. Be careful with
                  the <code class="literal">medium</code> setting and especially
                  the <code class="literal">full</code> setting, which has a large
                  performance impact.
</p>
</div>
<p>
                Use of the <code class="literal">medium</code> or
                <code class="literal">full</code> setting requires the
                <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege.
              </p><p>
                If a setting other than <code class="literal">current</code> is
                chosen, the current settings are restored at the end of
                the procedure.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-diagnostics-configuration-options"></a>Configuration Options</h5>

</div>

</div>

</div>
<p>
            <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a> operation can be
            modified using the following configuration options or their
            corresponding user-defined variables (see
            <a class="xref" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table">Section 26.4.2.1, “The sys_config Table”</a>):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">debug</code>, <code class="literal">@sys.debug</code>
              </p><p>
                If this option is <code class="literal">ON</code>, produce
                debugging output. The default is <code class="literal">OFF</code>.
              </p></li><li class="listitem"><p>
                <code class="literal">diagnostics.allow_i_s_tables</code>,
                <code class="literal">@sys.diagnostics.allow_i_s_tables</code>
              </p><p>
                If this option is <code class="literal">ON</code>, the
                <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a> procedure is
                permitted to perform table scans on the
                <a class="link" href="information-schema.html#tables-table" title="24.26 The INFORMATION_SCHEMA TABLES Table"><code class="literal">INFORMATION_SCHEMA.TABLES</code></a>
                table. This can be expensive if there are many tables.
                The default is <code class="literal">OFF</code>.
              </p></li><li class="listitem"><p>
                <code class="literal">diagnostics.include_raw</code>,
                <code class="literal">@sys.diagnostics.include_raw</code>
              </p><p>
                If this option is <code class="literal">ON</code>, the
                <a class="link" href="sys-schema.html#sys-diagnostics" title="26.4.4.2 The diagnostics() Procedure"><code class="literal">diagnostics()</code></a> procedure
                output includes the raw output from querying the
                <a class="link" href="sys-schema.html#sys-metrics" title="26.4.3.21 The metrics View"><code class="literal">metrics</code></a> view. The default
                is <code class="literal">OFF</code>.
              </p></li><li class="listitem"><p>
                <code class="literal">statement_truncate_len</code>,
                <code class="literal">@sys.statement_truncate_len</code>
              </p><p>
                The maximum length of statements returned by the
                <a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a>
                function. Longer statements are truncated to this
                length. The default is 64.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-diagnostics-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            Create a diagnostics report that starts an iteration every
            30 seconds and runs for at most 120 seconds using the
            current Performance Schema settings:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL diagnostics(120, 30, 'current');</code></strong>
</pre><p>
            To capture the output from the
            <code class="literal">diagnostics()</code> procedure in a file as it
            runs, use the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Tool"><span class="command"><strong>mysql</strong></span></a> client <code class="literal">tee
            <code class="filename">filename</code></code> and
            <code class="literal">notee</code> commands (see
            <a class="xref" href="programs.html#mysql-commands" title="4.5.1.2 mysql Commands">Section 4.5.1.2, “mysql Commands”</a>):
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>tee diag.out;</code></strong>
mysql&gt; <strong class="userinput"><code>CALL diagnostics(120, 30, 'current');</code></strong>
mysql&gt; <strong class="userinput"><code>notee;</code></strong>
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-execute-prepared-stmt"></a>26.4.4.3 The execute_prepared_stmt() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463879888"></a><a class="indexterm" name="idm139899463878496"></a><p>
          Given an SQL statement as a string, executes it as a prepared
          statement. The prepared statement is deallocated after
          execution, so it is not subject to reuse. Thus, this procedure
          is useful primarily for executing dynamic statements on a
          one-time basis.
        </p><p>
          This procedure uses
          <code class="literal">sys_execute_prepared_stmt</code> as the prepared
          statement name. If that statement name exists when the
          procedure is called, its previous content is destroyed.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-execute-prepared-stmt-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_query LONGTEXT CHARACTER SET utf8</code>:
                The statement string to execute.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-execute-prepared-stmt-configuration-options"></a>Configuration Options</h5>

</div>

</div>

</div>
<p>
            <a class="link" href="sys-schema.html#sys-execute-prepared-stmt" title="26.4.4.3 The execute_prepared_stmt() Procedure"><code class="literal">execute_prepared_stmt()</code></a>
            operation can be modified using the following configuration
            options or their corresponding user-defined variables (see
            <a class="xref" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table">Section 26.4.2.1, “The sys_config Table”</a>):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">debug</code>, <code class="literal">@sys.debug</code>
              </p><p>
                If this option is <code class="literal">ON</code>, produce
                debugging output. The default is <code class="literal">OFF</code>.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-execute-prepared-stmt-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL execute_prepared_stmt('SELECT COUNT(*) FROM mysql.user');</code></strong>
+----------+
| COUNT(*) |
+----------+
|       15 |
+----------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-disable-background-threads"></a>26.4.4.4 The ps_setup_disable_background_threads() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463861504"></a><a class="indexterm" name="idm139899463860112"></a><p>
          Disables Performance Schema instrumentation for all background
          threads. Produces a result set indicating how many background
          threads were disabled. Already disabled threads do not count.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-disable-background-threads-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-disable-background-threads-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_disable_background_threads();</code></strong>
+--------------------------------+
| summary                        |
+--------------------------------+
| Disabled 24 background threads |
+--------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-disable-consumer"></a>26.4.4.5 The ps_setup_disable_consumer() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463853008"></a><a class="indexterm" name="idm139899463851616"></a><p>
          Disables Performance Schema consumers with names that contain
          the argument. Produces a result set indicating how many
          consumers were disabled. Already disabled consumers do not
          count.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-disable-consumer-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">consumer VARCHAR(128)</code>: The value used
                to match consumer names, which are identified by using
                <code class="literal">%consumer%</code> as an operand for a
                <a class="link" href="functions.html#operator_like"><code class="literal">LIKE</code></a> pattern match.
              </p><p>
                A value of <code class="literal">''</code> matches all consumers.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-disable-consumer-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            Disable all statement consumers:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_disable_consumer('statement');</code></strong>
+----------------------+
| summary              |
+----------------------+
| Disabled 4 consumers |
+----------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-disable-instrument"></a>26.4.4.6 The ps_setup_disable_instrument() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463839936"></a><a class="indexterm" name="idm139899463838544"></a><p>
          Disables Performance Schema instruments with names that
          contain the argument. Produces a result set indicating how
          many instruments were disabled. Already disabled instruments
          do not count.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-disable-instrument-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_pattern VARCHAR(128)</code>: The value
                used to match instrument names, which are identified by
                using <code class="literal">%in_pattern%</code> as an operand for
                a <a class="link" href="functions.html#operator_like"><code class="literal">LIKE</code></a> pattern match.
              </p><p>
                A value of <code class="literal">''</code> matches all
                instruments.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-disable-instrument-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            Disable a specific instrument:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_disable_instrument('wait/lock/metadata/sql/mdl');</code></strong>
+-----------------------+
| summary               |
+-----------------------+
| Disabled 1 instrument |
+-----------------------+
</pre><p>
            Disable all mutex instruments:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_disable_instrument('mutex');</code></strong>
+--------------------------+
| summary                  |
+--------------------------+
| Disabled 177 instruments |
+--------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-disable-thread"></a>26.4.4.7 The ps_setup_disable_thread() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463824752"></a><a class="indexterm" name="idm139899463823360"></a><p>
          Given a connection ID, disables Performance Schema
          instrumentation for the thread. Produces a result set
          indicating how many threads were disabled. Already disabled
          threads do not count.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-disable-thread-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_connection_id BIGINT</code>: The
                connection ID. This is a connection ID as given in the
                <code class="literal">PROCESSLIST_ID</code> column of the
                Performance Schema <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a>
                table or the <code class="literal">Id</code> column of
                <a class="link" href="sql-syntax.html#show-processlist" title="13.7.6.29 SHOW PROCESSLIST Syntax"><code class="literal">SHOW PROCESSLIST</code></a> output.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-disable-thread-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            Disable a specific connection by its connection ID:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_disable_thread(225);</code></strong>
+-------------------+
| summary           |
+-------------------+
| Disabled 1 thread |
+-------------------+
</pre><p>
            Disable the current connection:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_disable_thread(CONNECTION_ID());</code></strong>
+-------------------+
| summary           |
+-------------------+
| Disabled 1 thread |
+-------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-enable-background-threads"></a>26.4.4.8 The ps_setup_enable_background_threads() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463809088"></a><a class="indexterm" name="idm139899463807696"></a><p>
          Enables Performance Schema instrumentation for all background
          threads. Produces a result set indicating how many background
          threads were enabled. Already enabled threads do not count.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-enable-background-threads-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-enable-background-threads-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_enable_background_threads();</code></strong>
+-------------------------------+
| summary                       |
+-------------------------------+
| Enabled 24 background threads |
+-------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-enable-consumer"></a>26.4.4.9 The ps_setup_enable_consumer() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463800592"></a><a class="indexterm" name="idm139899463799200"></a><p>
          Enables Performance Schema consumers with names that contain
          the argument. Produces a result set indicating how many
          consumers were enabled. Already enabled consumers do not
          count.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-enable-consumer-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">consumer VARCHAR(128)</code>: The value used
                to match consumer names, which are identified by using
                <code class="literal">%consumer%</code> as an operand for a
                <a class="link" href="functions.html#operator_like"><code class="literal">LIKE</code></a> pattern match.
              </p><p>
                A value of <code class="literal">''</code> matches all consumers.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-enable-consumer-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            Enable all statement consumers:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_enable_consumer('statement');</code></strong>
+---------------------+
| summary             |
+---------------------+
| Enabled 4 consumers |
+---------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-enable-instrument"></a>26.4.4.10 The ps_setup_enable_instrument() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463787616"></a><a class="indexterm" name="idm139899463786224"></a><p>
          Enables Performance Schema instruments with names that contain
          the argument. Produces a result set indicating how many
          instruments were enabled. Already enabled instruments do not
          count.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-enable-instrument-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_pattern VARCHAR(128)</code>: The value
                used to match instrument names, which are identified by
                using <code class="literal">%in_pattern%</code> as an operand for
                a <a class="link" href="functions.html#operator_like"><code class="literal">LIKE</code></a> pattern match.
              </p><p>
                A value of <code class="literal">''</code> matches all
                instruments.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-enable-instrument-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            Enable a specific instrument:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_enable_instrument('wait/lock/metadata/sql/mdl');</code></strong>
+----------------------+
| summary              |
+----------------------+
| Enabled 1 instrument |
+----------------------+
</pre><p>
            Enable all mutex instruments:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_enable_instrument('mutex');</code></strong>
+-------------------------+
| summary                 |
+-------------------------+
| Enabled 177 instruments |
+-------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-enable-thread"></a>26.4.4.11 The ps_setup_enable_thread() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463772432"></a><a class="indexterm" name="idm139899463771040"></a><p>
          Given a connection ID, enables Performance Schema
          instrumentation for the thread. Produces a result set
          indicating how many threads were enabled. Already enabled
          threads do not count.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-enable-thread-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_connection_id BIGINT</code>: The
                connection ID. This is a connection ID as given in the
                <code class="literal">PROCESSLIST_ID</code> column of the
                Performance Schema <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a>
                table or the <code class="literal">Id</code> column of
                <a class="link" href="sql-syntax.html#show-processlist" title="13.7.6.29 SHOW PROCESSLIST Syntax"><code class="literal">SHOW PROCESSLIST</code></a> output.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-enable-thread-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            Enable a specific connection by its connection ID:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_enable_thread(225);</code></strong>
+------------------+
| summary          |
+------------------+
| Enabled 1 thread |
+------------------+
</pre><p>
            Enable the current connection:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_enable_thread(CONNECTION_ID());</code></strong>
+------------------+
| summary          |
+------------------+
| Enabled 1 thread |
+------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-reload-saved"></a>26.4.4.12 The ps_setup_reload_saved() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463756768"></a><a class="indexterm" name="idm139899463755376"></a><p>
          Reloads a Performance Schema configuration saved earlier
          within the same session using
          <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a>. For more
          information, see the description of
          <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a>.
        </p><p>
          This procedure requires the
          <a class="link" href="security.html#priv_system-variables-admin"><code class="literal">SYSTEM_VARIABLES_ADMIN</code></a> or
          <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege because it
          manipulates the session
          <a class="link" href="server-administration.html#sysvar_sql_log_bin"><code class="literal">sql_log_bin</code></a> system variable
          to disable binary logging during its execution.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-reload-saved-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-reset-to-default"></a>26.4.4.13 The ps_setup_reset_to_default() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463745472"></a><a class="indexterm" name="idm139899463744080"></a><p>
          Resets the Performance Schema configuration to its default
          settings.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-reset-to-default-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_verbose BOOLEAN</code>: Whether to
                display information about each setup stage during
                procedure execution. This includes the SQL statements
                executed.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-reset-to-default-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_reset_to_default(TRUE)\G</code></strong>
*************************** 1. row ***************************
status: Resetting: setup_actors
DELETE
FROM performance_schema.setup_actors
WHERE NOT (HOST = '%' AND USER = '%' AND ROLE = '%')

*************************** 1. row ***************************
status: Resetting: setup_actors
INSERT IGNORE INTO performance_schema.setup_actors
VALUES ('%', '%', '%')

...
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-save"></a>26.4.4.14 The ps_setup_save() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463735312"></a><a class="indexterm" name="idm139899463733920"></a><p>
          Saves the current Performance Schema configuration. This
          enables you to alter the configuration temporarily for
          debugging or other purposes, then restore it to the previous
          state by invoking the
          <a class="link" href="sys-schema.html#sys-ps-setup-reload-saved" title="26.4.4.12 The ps_setup_reload_saved() Procedure"><code class="literal">ps_setup_reload_saved()</code></a>
          procedure.
        </p><p>
          To prevent other simultaneous calls to save the configuration,
          <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a> acquires an
          advisory lock named <code class="literal">sys.ps_setup_save</code> by
          calling the <a class="link" href="functions.html#function_get-lock"><code class="literal">GET_LOCK()</code></a>
          function. <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a> takes
          a timeout parameter to indicate how many seconds to wait if
          the lock already exists (which indicates that some other
          session has a saved configuration outstanding). If the timeout
          expires without obtaining the lock,
          <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a> fails.
        </p><p>
          It is intended you call
          <a class="link" href="sys-schema.html#sys-ps-setup-reload-saved" title="26.4.4.12 The ps_setup_reload_saved() Procedure"><code class="literal">ps_setup_reload_saved()</code></a> later
          within the <span class="emphasis"><em>same</em></span> session as
          <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a> because the
          configuration is saved in <code class="literal">TEMPORARY</code> tables.
          <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a> drops the
          temporary tables and releases the lock. If you end your
          session without invoking
          <a class="link" href="sys-schema.html#sys-ps-setup-save" title="26.4.4.14 The ps_setup_save() Procedure"><code class="literal">ps_setup_save()</code></a>, the tables and
          lock disappear automatically.
        </p><p>
          This procedure requires the
          <a class="link" href="security.html#priv_system-variables-admin"><code class="literal">SYSTEM_VARIABLES_ADMIN</code></a> or
          <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege because it
          manipulates the session
          <a class="link" href="server-administration.html#sysvar_sql_log_bin"><code class="literal">sql_log_bin</code></a> system variable
          to disable binary logging during its execution.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-save-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_timeout INT</code>: How many seconds to
                wait to obtain the <code class="literal">sys.ps_setup_save</code>
                lock. A negative timeout value means infinite timeout.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-save-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_save(10);</code></strong>

... <em class="replaceable"><code>make Performance Schema configuration changes</code></em> ...

mysql&gt; <strong class="userinput"><code>CALL ps_setup_reload_saved();</code></strong>
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-show-disabled"></a>26.4.4.15 The ps_setup_show_disabled() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463708320"></a><a class="indexterm" name="idm139899463706928"></a><p>
          Displays all currently disabled Performance Schema
          configuration.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-disabled-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_show_instruments BOOLEAN</code>: Whether
                to display disabled instruments. This might be a long
                list.
              </p></li><li class="listitem"><p>
                <code class="literal">in_show_threads BOOLEAN</code>: Whether to
                display disabled threads.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-disabled-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; CALL ps_setup_show_disabled(TRUE, TRUE);
+----------------------------+
| performance_schema_enabled |
+----------------------------+
|                          1 |
+----------------------------+

+---------------+
| enabled_users |
+---------------+
| '%'@'%'       |
+---------------+

+-------------+----------------------+---------+-------+
| object_type | objects              | enabled | timed |
+-------------+----------------------+---------+-------+
| EVENT       | mysql.%              | NO      | NO    |
| EVENT       | performance_schema.% | NO      | NO    |
| EVENT       | information_schema.% | NO      | NO    |
| FUNCTION    | mysql.%              | NO      | NO    |
| FUNCTION    | performance_schema.% | NO      | NO    |
| FUNCTION    | information_schema.% | NO      | NO    |
| PROCEDURE   | mysql.%              | NO      | NO    |
| PROCEDURE   | performance_schema.% | NO      | NO    |
| PROCEDURE   | information_schema.% | NO      | NO    |
| TABLE       | mysql.%              | NO      | NO    |
| TABLE       | performance_schema.% | NO      | NO    |
| TABLE       | information_schema.% | NO      | NO    |
| TRIGGER     | mysql.%              | NO      | NO    |
| TRIGGER     | performance_schema.% | NO      | NO    |
| TRIGGER     | information_schema.% | NO      | NO    |
+-------------+----------------------+---------+-------+

...
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-show-disabled-consumers"></a>26.4.4.16 The ps_setup_show_disabled_consumers() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463694976"></a><a class="indexterm" name="idm139899463693584"></a><p>
          Displays all currently disabled Performance Schema consumers.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-disabled-consumers-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-disabled-consumers-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_show_disabled_consumers();</code></strong>
+----------------------------------+
| disabled_consumers               |
+----------------------------------+
| events_stages_current            |
| events_stages_history            |
| events_stages_history_long       |
| events_statements_history        |
| events_statements_history_long   |
| events_transactions_history      |
| events_transactions_history_long |
| events_waits_current             |
| events_waits_history             |
| events_waits_history_long        |
+----------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-show-disabled-instruments"></a>26.4.4.17 The ps_setup_show_disabled_instruments() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463686288"></a><a class="indexterm" name="idm139899463684896"></a><p>
          Displays all currently disabled Performance Schema
          instruments. This might be a long list.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-disabled-instruments-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-disabled-instruments-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_show_disabled_instruments()\G</code></strong>
*************************** 1. row ***************************
disabled_instruments: wait/synch/mutex/sql/TC_LOG_MMAP::LOCK_tc
               timed: NO
*************************** 2. row ***************************
disabled_instruments: wait/synch/mutex/sql/THD::LOCK_query_plan
               timed: NO
*************************** 3. row ***************************
disabled_instruments: wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_commit
               timed: NO
...
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-show-enabled"></a>26.4.4.18 The ps_setup_show_enabled() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463677600"></a><a class="indexterm" name="idm139899463676208"></a><p>
          Displays all currently enabled Performance Schema
          configuration.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-enabled-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_show_instruments BOOLEAN</code>: Whether
                to display enabled instruments. This might be a long
                list.
              </p></li><li class="listitem"><p>
                <code class="literal">in_show_threads BOOLEAN</code>: Whether to
                display enabled threads.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-enabled-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_show_enabled(FALSE, FALSE);</code></strong>
+----------------------------+
| performance_schema_enabled |
+----------------------------+
|                          1 |
+----------------------------+
1 row in set (0.00 sec)

+---------------+
| enabled_users |
+---------------+
| '%'@'%'       |
+---------------+
1 row in set (0.00 sec)

+-------------+----------------------+---------+-------+
| object_type | objects              | enabled | timed |
+-------------+----------------------+---------+-------+
| EVENT       | %.%                  | YES     | YES   |
| FUNCTION    | %.%                  | YES     | YES   |
| PROCEDURE   | %.%                  | YES     | YES   |
| TABLE       | %.%                  | YES     | YES   |
| TRIGGER     | %.%                  | YES     | YES   |
+-------------+----------------------+---------+-------+
5 rows in set (0.01 sec)

+-----------------------------+
| enabled_consumers           |
+-----------------------------+
| events_statements_current   |
| events_transactions_current |
| global_instrumentation      |
| thread_instrumentation      |
| statements_digest           |
+-----------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-show-enabled-consumers"></a>26.4.4.19 The ps_setup_show_enabled_consumers() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463665296"></a><a class="indexterm" name="idm139899463663904"></a><p>
          Displays all currently enabled Performance Schema consumers.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-enabled-consumers-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-enabled-consumers-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_show_enabled_consumers();</code></strong>
+-----------------------------+
| enabled_consumers           |
+-----------------------------+
| events_statements_current   |
| events_transactions_current |
| global_instrumentation      |
| thread_instrumentation      |
| statements_digest           |
+-----------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-setup-show-enabled-instruments"></a>26.4.4.20 The ps_setup_show_enabled_instruments() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463656832"></a><a class="indexterm" name="idm139899463655440"></a><p>
          Displays all currently enabled Performance Schema instruments.
          This might be a long list.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-enabled-instruments-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-setup-show-enabled-instruments-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_setup_show_enabled_instruments()\G</code></strong>
*************************** 1. row ***************************
enabled_instruments: wait/io/file/sql/map
              timed: YES
*************************** 2. row ***************************
enabled_instruments: wait/io/file/sql/binlog
              timed: YES
*************************** 3. row ***************************
enabled_instruments: wait/io/file/sql/binlog_cache
              timed: YES
...
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-statement-avg-latency-histogram"></a>26.4.4.21 The ps_statement_avg_latency_histogram() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463647808"></a><a class="indexterm" name="idm139899463646416"></a><p>
          Displays a textual histogram graph of the average latency
          values across all normalized statements tracked within the
          Performance Schema
          <a class="link" href="performance-schema.html#statement-summary-tables" title="25.11.15.3 Statement Summary Tables"><code class="literal">events_statements_summary_by_digest</code></a>
          table.
        </p><p>
          This procedure can be used to display a very high-level
          picture of the latency distribution of statements running
          within this MySQL instance.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-statement-avg-latency-histogram-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-statement-avg-latency-histogram-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            The histogram output in statement units. For example,
            <code class="literal">* = 2 units</code> in the histogram legend means
            that each <code class="literal">*</code> character represents 2
            statements.
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_statement_avg_latency_histogram()\G</code></strong>
*************************** 1. row ***************************
Performance Schema Statement Digest Average Latency Histogram:

  . = 1 unit
  * = 2 units
  # = 3 units

(0 - 66ms)     88  | #############################
(66 - 133ms)   14  | ..............
(133 - 199ms)  4   | ....
(199 - 265ms)  5   | **
(265 - 332ms)  1   | .
(332 - 398ms)  0   |
(398 - 464ms)  1   | .
(464 - 531ms)  0   |
(531 - 597ms)  0   |
(597 - 663ms)  0   |
(663 - 730ms)  0   |
(730 - 796ms)  0   |
(796 - 863ms)  0   |
(863 - 929ms)  0   |
(929 - 995ms)  0   |
(995 - 1062ms) 0   |

  Total Statements: 114; Buckets: 16; Bucket Size: 66 ms;
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-trace-statement-digest"></a>26.4.4.22 The ps_trace_statement_digest() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463635536"></a><a class="indexterm" name="idm139899463634144"></a><p>
          Traces all Performance Schema instrumentation for a specific
          statement digest.
        </p><p>
          If you find a statement of interest within the Performance
          Schema
          <a class="link" href="performance-schema.html#statement-summary-tables" title="25.11.15.3 Statement Summary Tables"><code class="literal">events_statements_summary_by_digest</code></a>
          table, specify its <code class="literal">DIGEST</code> column MD5 value
          to this procedure and indicate the polling duration and
          interval. The result is a report of all statistics tracked
          within Performance Schema for that digest for the interval.
        </p><p>
          The procedure also attempts to execute
          <a class="link" href="sql-syntax.html#explain" title="13.8.2 EXPLAIN Syntax"><code class="literal">EXPLAIN</code></a> for the longest running
          example of the digest during the interval. This attempt might
          fail because the Performance Schema truncates long
          <code class="literal">SQL_TEXT</code> values. Consequently,
          <a class="link" href="sql-syntax.html#explain" title="13.8.2 EXPLAIN Syntax"><code class="literal">EXPLAIN</code></a> will fail due to parse
          errors.
        </p><p>
          This procedure requires the
          <a class="link" href="security.html#priv_system-variables-admin"><code class="literal">SYSTEM_VARIABLES_ADMIN</code></a> or
          <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege because it
          manipulates the session
          <a class="link" href="server-administration.html#sysvar_sql_log_bin"><code class="literal">sql_log_bin</code></a> system variable
          to disable binary logging during its execution.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-trace-statement-digest-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_digest VARCHAR(32)</code>: The statement
                digest identifier to analyze.
              </p></li><li class="listitem"><p>
                <code class="literal">in_runtime INT</code>: How long to run the
                analysis in seconds.
              </p></li><li class="listitem"><p>
                <code class="literal">in_interval DECIMAL(2,2)</code>: The
                analysis interval in seconds (which can be fractional)
                at which to try to take snapshots.
              </p></li><li class="listitem"><p>
                <code class="literal">in_start_fresh BOOLEAN</code>: Whether to
                truncate the Performance Schema
                <a class="link" href="performance-schema.html#events-statements-history-long-table" title="25.11.6.3 The events_statements_history_long Table"><code class="literal">events_statements_history_long</code></a>
                and
                <a class="link" href="performance-schema.html#events-stages-history-long-table" title="25.11.5.3 The events_stages_history_long Table"><code class="literal">events_stages_history_long</code></a>
                tables before starting.
              </p></li><li class="listitem"><p>
                <code class="literal">in_auto_enable BOOLEAN</code>: Whether to
                automatically enable required consumers.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-trace-statement-digest-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_trace_statement_digest('891ec6860f98ba46d89dd20b0c03652c', 10, 0.1, TRUE, TRUE);</code></strong>
+--------------------+
| SUMMARY STATISTICS |
+--------------------+
| SUMMARY STATISTICS |
+--------------------+
1 row in set (9.11 sec)

+------------+-----------+-----------+-----------+---------------+------------+------------+
| executions | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scans |
+------------+-----------+-----------+-----------+---------------+------------+------------+
|         21 | 4.11 ms   | 2.00 ms   |         0 |            21 |          0 |          0 |
+------------+-----------+-----------+-----------+---------------+------------+------------+
1 row in set (9.11 sec)

+------------------------------------------+-------+-----------+
| event_name                               | count | latency   |
+------------------------------------------+-------+-----------+
| stage/sql/statistics                     |    16 | 546.92 us |
| stage/sql/freeing items                  |    18 | 520.11 us |
| stage/sql/init                           |    51 | 466.80 us |
...
| stage/sql/cleaning up                    |    18 | 11.92 us  |
| stage/sql/executing                      |    16 | 6.95 us   |
+------------------------------------------+-------+-----------+
17 rows in set (9.12 sec)

+---------------------------+
| LONGEST RUNNING STATEMENT |
+---------------------------+
| LONGEST RUNNING STATEMENT |
+---------------------------+
1 row in set (9.16 sec)

+-----------+-----------+-----------+-----------+---------------+------------+-----------+
| thread_id | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scan |
+-----------+-----------+-----------+-----------+---------------+------------+-----------+
|    166646 | 618.43 us | 1.00 ms   |         0 |             1 |          0 |         0 |
+-----------+-----------+-----------+-----------+---------------+------------+-----------+
1 row in set (9.16 sec)

# Truncated for clarity...
+-----------------------------------------------------------------+
| sql_text                                                        |
+-----------------------------------------------------------------+
| select hibeventhe0_.id as id1382_, hibeventhe0_.createdTime ... |
+-----------------------------------------------------------------+
1 row in set (9.17 sec)

+------------------------------------------+-----------+
| event_name                               | latency   |
+------------------------------------------+-----------+
| stage/sql/init                           | 8.61 us   |
| stage/sql/init                           | 331.07 ns |
...
| stage/sql/freeing items                  | 30.46 us  |
| stage/sql/cleaning up                    | 662.13 ns |
+------------------------------------------+-----------+
18 rows in set (9.23 sec)

+----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
| id | select_type | table        | type  | possible_keys | key       | key_len | ref         | rows | Extra |
+----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
|  1 | SIMPLE      | hibeventhe0_ | const | fixedTime     | fixedTime | 775     | const,const |    1 | NULL  |
+----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+
1 row in set (9.27 sec)

Query OK, 0 rows affected (9.28 sec)
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-trace-thread"></a>26.4.4.23 The ps_trace_thread() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463601776"></a><a class="indexterm" name="idm139899463600384"></a><p>
          Dumps all Performance Schema data for an instrumented thread
          to a <code class="filename">.dot</code> formatted graph file (for the
          DOT graph description language). Each result set returned from
          the procedure should be used for a complete graph.
        </p><p>
          This procedure requires the
          <a class="link" href="security.html#priv_system-variables-admin"><code class="literal">SYSTEM_VARIABLES_ADMIN</code></a> or
          <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege because it
          manipulates the session
          <a class="link" href="server-administration.html#sysvar_sql_log_bin"><code class="literal">sql_log_bin</code></a> system variable
          to disable binary logging during its execution.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-trace-thread-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_thread_id INT</code>: The thread to
                trace.
              </p></li><li class="listitem"><p>
                <code class="literal">in_outfile VARCHAR(255)</code>: The name to
                use for the <code class="filename">.dot</code> output file.
              </p></li><li class="listitem"><p>
                <code class="literal">in_max_runtime DECIMAL(20,2)</code>: The
                maximum number of seconds (which can be fractional) to
                collect data. Use <code class="literal">NULL</code> to collect
                data for the default of 60 seconds.
              </p></li><li class="listitem"><p>
                <code class="literal">in_interval DECIMAL(20,2)</code>: The number
                of seconds (which can be fractional) to sleep between
                data collections. Use <code class="literal">NULL</code> to sleep
                for the default of 1 second.
              </p></li><li class="listitem"><p>
                <code class="literal">in_start_fresh BOOLEAN</code>: Whether to
                reset all Performance Schema data before tracing.
              </p></li><li class="listitem"><p>
                <code class="literal">in_auto_setup BOOLEAN</code>: Whether to
                disable all other threads and enable all instruments and
                consumers. This also resets the settings at the end of
                the run.
              </p></li><li class="listitem"><p>
                <code class="literal">in_debug BOOLEAN</code>: Whether to include
                <code class="literal">file:lineno</code> information in the graph.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-trace-thread-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_trace_thread(25, CONCAT('/tmp/stack-', REPLACE(NOW(), ' ', '-'), '.dot'), NULL, NULL, TRUE, TRUE, TRUE);</code></strong>
+-------------------+
| summary           |
+-------------------+
| Disabled 1 thread |
+-------------------+
1 row in set (0.00 sec)

+---------------------------------------------+
| Info                                        |
+---------------------------------------------+
| Data collection starting for THREAD_ID = 25 |
+---------------------------------------------+
1 row in set (0.03 sec)

+-----------------------------------------------------------+
| Info                                                      |
+-----------------------------------------------------------+
| Stack trace written to /tmp/stack-2014-02-16-21:18:41.dot |
+-----------------------------------------------------------+
1 row in set (60.07 sec)

+-------------------------------------------------------------------+
| Convert to PDF                                                    |
+-------------------------------------------------------------------+
| dot -Tpdf -o /tmp/stack_25.pdf /tmp/stack-2014-02-16-21:18:41.dot |
+-------------------------------------------------------------------+
1 row in set (60.07 sec)

+-------------------------------------------------------------------+
| Convert to PNG                                                    |
+-------------------------------------------------------------------+
| dot -Tpng -o /tmp/stack_25.png /tmp/stack-2014-02-16-21:18:41.dot |
+-------------------------------------------------------------------+
1 row in set (60.07 sec)

+------------------+
| summary          |
+------------------+
| Enabled 1 thread |
+------------------+
1 row in set (60.32 sec)
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-truncate-all-tables"></a>26.4.4.24 The ps_truncate_all_tables() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463574496"></a><a class="indexterm" name="idm139899463573104"></a><p>
          Truncates all Performance Schema summary tables, resetting all
          aggregated instrumentation as a snapshot. Produces a result
          set indicating how many tables were truncated.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-truncate-all-tables-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_verbose BOOLEAN</code>: Whether to
                display each <a class="link" href="sql-syntax.html#truncate-table" title="13.1.34 TRUNCATE TABLE Syntax"><code class="literal">TRUNCATE
                TABLE</code></a> statement before executing it.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-truncate-all-tables-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL ps_truncate_all_tables(FALSE);</code></strong>
+---------------------+
| summary             |
+---------------------+
| Truncated 44 tables |
+---------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-statement-performance-analyzer"></a>26.4.4.25 The statement_performance_analyzer() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463563680"></a><a class="indexterm" name="idm139899463562288"></a><p>
          Creates a report of the statements running on the server. The
          views are calculated based on the overall and/or delta
          activity.
        </p><p>
          This procedure requires the
          <a class="link" href="security.html#priv_system-variables-admin"><code class="literal">SYSTEM_VARIABLES_ADMIN</code></a> or
          <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege because it
          manipulates the session
          <a class="link" href="server-administration.html#sysvar_sql_log_bin"><code class="literal">sql_log_bin</code></a> system variable
          to disable binary logging during its execution.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-statement-performance-analyzer-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_action ENUM('snapshot', 'overall', 'delta',
                'create_tmp', 'create_table', 'save',
                'cleanup')</code>: The action to take. These values
                are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                    <code class="literal">snapshot</code>: Store a snapshot. The
                    default is to make a snapshot of the current content
                    of the Performance Schema
                    <a class="link" href="performance-schema.html#statement-summary-tables" title="25.11.15.3 Statement Summary Tables"><code class="literal">events_statements_summary_by_digest</code></a>
                    table. By setting <code class="literal">in_table</code>, this
                    can be overwritten to copy the content of the
                    specified table. The snapshot is stored in the
                    <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema
                    <code class="literal">tmp_digests</code> temporary table.
                  </p></li><li class="listitem"><p>
                    <code class="literal">overall</code>: Generate an analysis
                    based on the content of the table specified by
                    <code class="literal">in_table</code>. For the overall
                    analysis, <code class="literal">in_table</code> can be
                    <a class="link" href="functions.html#function_now"><code class="literal">NOW()</code></a> to use a fresh
                    snapshot. This overwrites an existing snapshot. Use
                    <code class="literal">NULL</code> for
                    <code class="literal">in_table</code> to use the existing
                    snapshot. If <code class="literal">in_table</code> is
                    <code class="literal">NULL</code> and no snapshot exists, a
                    new snapshot is created. The
                    <code class="literal">in_views</code> parameter and the
                    <code class="literal">statement_performance_analyzer.limit</code>
                    configuration option affect the operation of this
                    procedure.
                  </p></li><li class="listitem"><p>
                    <code class="literal">delta</code>: Generate a delta analysis.
                    The delta is calculated between the reference table
                    specified by <code class="literal">in_table</code> and the
                    snapshot, which must exist. This action uses the
                    <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema
                    <code class="literal">tmp_digests_delta</code> temporary
                    table. The <code class="literal">in_views</code> parameter and
                    the
                    <code class="literal">statement_performance_analyzer.limit</code>
                    configuration option affect the operation of this
                    procedure.
                  </p></li><li class="listitem"><p>
                    <code class="literal">create_table</code>: Create a regular
                    table suitable for storing the snapshot for later
                    use (for example, for calculating deltas).
                  </p></li><li class="listitem"><p>
                    <code class="literal">create_tmp</code>: Create a temporary
                    table suitable for storing the snapshot for later
                    use (for example, for calculating deltas).
                  </p></li><li class="listitem"><p>
                    <code class="literal">save</code>: Save the snapshot in the
                    table specified by <code class="literal">in_table</code>. The
                    table must exist and have the correct structure. If
                    no snapshot exists, a new snapshot is created.
                  </p></li><li class="listitem"><p>
                    <code class="literal">cleanup</code>: Remove the temporary
                    tables used for the snapshot and delta.
</p></li></ul>
</div>
</li><li class="listitem"><p>
                <code class="literal">in_table VARCHAR(129)</code>: The table
                parameter used for some of the actions specified by the
                <code class="literal">in_action</code> parameter. Use the format
                <em class="replaceable"><code>db_name.tbl_name</code></em> or
                <em class="replaceable"><code>tbl_name</code></em> without using any
                backtick (<code class="literal">`</code>) identifier-quoting
                characters. Periods (<code class="literal">.</code>) are not
                supported in database and table names.
              </p><p>
                The meaning of the <code class="literal">in_table</code> value for
                each <code class="literal">in_action</code> value is detailed in
                the individual <code class="literal">in_action</code> value
                descriptions.
              </p></li><li class="listitem"><p>
                <code class="literal">in_views SET
                ('with_runtimes_in_95th_percentile', 'analysis',
                'with_errors_or_warnings', 'with_full_table_scans',
                'with_sorting', 'with_temp_tables', 'custom')</code>:
                Which views to include. This parameter is a
                <code class="literal">SET</code> value, so it can contain multiple
                view names, separated by commas. The default is to
                include all views except <code class="literal">custom</code>. The
                following values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                    <code class="literal">with_runtimes_in_95th_percentile</code>:
                    Use the
                    <a class="link" href="sys-schema.html#sys-statements-with-runtimes-in-95th-percentile" title="26.4.3.38 The statements_with_runtimes_in_95th_percentile and x$statements_with_runtimes_in_95th_percentile Views"><code class="literal">statements_with_runtimes_in_95th_percentile</code></a>
                    view.
                  </p></li><li class="listitem"><p>
                    <code class="literal">analysis</code>: Use the
                    <a class="link" href="sys-schema.html#sys-statement-analysis" title="26.4.3.35 The statement_analysis and x$statement_analysis Views"><code class="literal">statement_analysis</code></a>
                    view.
                  </p></li><li class="listitem"><p>
                    <code class="literal">with_errors_or_warnings</code>: Use the
                    <a class="link" href="sys-schema.html#sys-statements-with-errors-or-warnings" title="26.4.3.36 The statements_with_errors_or_warnings and x$statements_with_errors_or_warnings Views"><code class="literal">statements_with_errors_or_warnings</code></a>
                    view.
                  </p></li><li class="listitem"><p>
                    <code class="literal">with_full_table_scans</code>: Use the
                    <a class="link" href="sys-schema.html#sys-statements-with-full-table-scans" title="26.4.3.37 The statements_with_full_table_scans and x$statements_with_full_table_scans Views"><code class="literal">statements_with_full_table_scans</code></a>
                    view.
                  </p></li><li class="listitem"><p>
                    <code class="literal">with_sorting</code>: Use the
                    <a class="link" href="sys-schema.html#sys-statements-with-sorting" title="26.4.3.39 The statements_with_sorting and x$statements_with_sorting Views"><code class="literal">statements_with_sorting</code></a>
                    view.
                  </p></li><li class="listitem"><p>
                    <code class="literal">with_temp_tables</code>: Use the
                    <a class="link" href="sys-schema.html#sys-statements-with-temp-tables" title="26.4.3.40 The statements_with_temp_tables and x$statements_with_temp_tables Views"><code class="literal">statements_with_temp_tables</code></a>
                    view.
                  </p></li><li class="listitem"><p>
                    <code class="literal">custom</code>: Use a custom view. This
                    view must be specified using the
                    <code class="literal">statement_performance_analyzer.view</code>
                    configuration option to name a query or an existing
                    view.
</p></li></ul>
</div>
</li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-statement-performance-analyzer-configuration-options"></a>Configuration Options</h5>

</div>

</div>

</div>
<p>
            <a class="link" href="sys-schema.html#sys-statement-performance-analyzer" title="26.4.4.25 The statement_performance_analyzer() Procedure"><code class="literal">statement_performance_analyzer()</code></a>
            operation can be modified using the following configuration
            options or their corresponding user-defined variables (see
            <a class="xref" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table">Section 26.4.2.1, “The sys_config Table”</a>):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">debug</code>, <code class="literal">@sys.debug</code>
              </p><p>
                If this option is <code class="literal">ON</code>, produce
                debugging output. The default is <code class="literal">OFF</code>.
              </p></li><li class="listitem"><p>
                <code class="literal">statement_performance_analyzer.limit</code>,
                <code class="literal">@sys.statement_performance_analyzer.limit</code>
              </p><p>
                The maximum number of rows to return for views that have
                no built-in limit. The default is 100.
              </p></li><li class="listitem"><p>
                <code class="literal">statement_performance_analyzer.view</code>,
                <code class="literal">@sys.statement_performance_analyzer.view</code>
              </p><p>
                The custom query or view to be used. If the option value
                contains a space, it is interpreted as a query.
                Otherwise, it must be the name of an existing view that
                queries the Performance Schema
                <a class="link" href="performance-schema.html#statement-summary-tables" title="25.11.15.3 Statement Summary Tables"><code class="literal">events_statements_summary_by_digest</code></a>
                table. There cannot be any <code class="literal">LIMIT</code>
                clause in the query or view definition if the
                <code class="literal">statement_performance_analyzer.limit</code>
                configuration option is greater than 0. If specifying a
                view, use the same format as for the
                <code class="literal">in_table</code> parameter. The default is
                <code class="literal">NULL</code> (no custom view defined).
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-statement-performance-analyzer-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            To create a report with the queries in the 95th percentile
            since the last truncation of
            <a class="link" href="performance-schema.html#statement-summary-tables" title="25.11.15.3 Statement Summary Tables"><code class="literal">events_statements_summary_by_digest</code></a>
            and with a one-minute delta period:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
                Create a temporary table to store the initial snapshot.
              </p></li><li class="listitem"><p>
                Create the initial snapshot.
              </p></li><li class="listitem"><p>
                Save the initial snapshot in the temporary table.
              </p></li><li class="listitem"><p>
                Wait one minute.
              </p></li><li class="listitem"><p>
                Create a new snapshot.
              </p></li><li class="listitem"><p>
                Perform analysis based on the new snapshot.
              </p></li><li class="listitem"><p>
                Perform analysis based on the delta between the initial
                and new snapshots.
</p></li></ol>
</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('create_tmp', 'mydb.tmp_digests_ini', NULL);</code></strong>
Query OK, 0 rows affected (0.08 sec)

mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('snapshot', NULL, NULL);</code></strong>
Query OK, 0 rows affected (0.02 sec)

mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('save', 'mydb.tmp_digests_ini', NULL);</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>DO SLEEP(60);</code></strong>
Query OK, 0 rows affected (1 min 0.00 sec)

mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('snapshot', NULL, NULL);</code></strong>
Query OK, 0 rows affected (0.02 sec)

mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('overall', NULL, 'with_runtimes_in_95th_percentile');</code></strong>
+-----------------------------------------+
| Next Output                             |
+-----------------------------------------+
| Queries with Runtime in 95th Percentile |
+-----------------------------------------+
1 row in set (0.05 sec)

...

mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('delta', 'mydb.tmp_digests_ini', 'with_runtimes_in_95th_percentile');</code></strong>
+-----------------------------------------+
| Next Output                             |
+-----------------------------------------+
| Queries with Runtime in 95th Percentile |
+-----------------------------------------+
1 row in set (0.03 sec)

...
</pre><p>
            Create an overall report of the 95th percentile queries and
            the top 10 queries with full table scans:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('snapshot', NULL, NULL);</code></strong>
Query OK, 0 rows affected (0.01 sec)                                 

mysql&gt; <strong class="userinput"><code>SET @sys.statement_performance_analyzer.limit = 10;</code></strong>
Query OK, 0 rows affected (0.00 sec)        

mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('overall', NULL, 'with_runtimes_in_95th_percentile,with_full_table_scans');</code></strong>
+-----------------------------------------+
| Next Output                             |
+-----------------------------------------+
| Queries with Runtime in 95th Percentile |
+-----------------------------------------+
1 row in set (0.01 sec)

...

+-------------------------------------+
| Next Output                         |
+-------------------------------------+
| Top 10 Queries with Full Table Scan |
+-------------------------------------+
1 row in set (0.09 sec)

...
</pre><p>
            Use a custom view showing the top 10 queries sorted by total
            execution time, refreshing the view every minute using the
            <span class="command"><strong>watch</strong></span> command in Linux:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CREATE OR REPLACE VIEW mydb.my_statements AS</code></strong>
    -&gt; <strong class="userinput"><code>SELECT sys.format_statement(DIGEST_TEXT) AS query,</code></strong>
    -&gt;        <strong class="userinput"><code>SCHEMA_NAME AS db,</code></strong>
    -&gt;        <strong class="userinput"><code>COUNT_STAR AS exec_count,</code></strong>
    -&gt;        <strong class="userinput"><code>sys.format_time(SUM_TIMER_WAIT) AS total_latency,</code></strong>
    -&gt;        <strong class="userinput"><code>sys.format_time(AVG_TIMER_WAIT) AS avg_latency,</code></strong>
    -&gt;        <strong class="userinput"><code>ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg,</code></strong>
    -&gt;        <strong class="userinput"><code>ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0)) AS rows_examined_avg,</code></strong>
    -&gt;        <strong class="userinput"><code>ROUND(IFNULL(SUM_ROWS_AFFECTED / NULLIF(COUNT_STAR, 0), 0)) AS rows_affected_avg,</code></strong>
    -&gt;        <strong class="userinput"><code>DIGEST AS digest</code></strong>
    -&gt;   <strong class="userinput"><code>FROM performance_schema.events_statements_summary_by_digest</code></strong>
    -&gt; <strong class="userinput"><code>ORDER BY SUM_TIMER_WAIT DESC;</code></strong>
Query OK, 0 rows affected (0.01 sec)

mysql&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('create_table', 'mydb.digests_prev', NULL);</code></strong>
Query OK, 0 rows affected (0.10 sec)

shell&gt; <strong class="userinput"><code>watch -n 60 "mysql sys --table -e \"</code></strong>
&gt; <strong class="userinput"><code>SET @sys.statement_performance_analyzer.view = 'mydb.my_statements';</code></strong>
&gt; <strong class="userinput"><code>SET @sys.statement_performance_analyzer.limit = 10;</code></strong>
&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('snapshot', NULL, NULL);</code></strong>
&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('delta', 'mydb.digests_prev', 'custom');</code></strong>
&gt; <strong class="userinput"><code>CALL statement_performance_analyzer('save', 'mydb.digests_prev', NULL);</code></strong>
&gt; <strong class="userinput"><code>\""</code></strong>

Every 60.0s: mysql sys --table -e "        ...  Mon Dec 22 10:58:51 2014

+----------------------------------+
| Next Output                      |
+----------------------------------+
| Top 10 Queries Using Custom View |
+----------------------------------+
+-------------------+-------+------------+---------------+-------------+---------------+-------------------+-------------------+----------------------------------+
| query             | db    | exec_count | total_latency | avg_latency | rows_sent_avg | rows_examined_avg | rows_affected_avg | digest                           |
+-------------------+-------+------------+---------------+-------------+---------------+-------------------+-------------------+----------------------------------+
...
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-table-exists"></a>26.4.4.26 The table_exists() Procedure</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463446400"></a><a class="indexterm" name="idm139899463445008"></a><p>
          Tests whether a given table exists as a regular table, a
          <code class="literal">TEMPORARY</code> table, or a view. The procedure
          returns the table type in an <code class="literal">OUT</code> parameter.
          If both a temporary and a permanent table exist with the given
          name, <code class="literal">TEMPORARY</code> is returned.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-table-exists-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_db VARCHAR(64)</code>: The name of the
                database in which to check for table existance.
              </p></li><li class="listitem"><p>
                <code class="literal">in_table VARCHAR(64)</code>: The name of the
                table to check the existance of.
              </p></li><li class="listitem"><p>
                <code class="literal">out_exists ENUM('', 'BASE TABLE', 'VIEW',
                'TEMPORARY')</code>: The return value. This is an
                <code class="literal">OUT</code> parameter, so it must be a
                variable into which the table type can be stored. When
                the procedure returns, the variable has one of the
                following values to indicate whether the table exists:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                    <code class="literal">''</code>: The table name does not exist
                    as a base table, <code class="literal">TEMPORARY</code> table,
                    or view.
                  </p></li><li class="listitem"><p>
                    <code class="literal">BASE TABLE</code>: The table name exists
                    as a base (permanent) table.
                  </p></li><li class="listitem"><p>
                    <code class="literal">VIEW</code>: The table name exists as a
                    view.
                  </p></li><li class="listitem"><p>
                    <code class="literal">TEMPORARY</code>: The table name exists
                    as a <code class="literal">TEMPORARY</code> table.
</p></li></ul>
</div>
</li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-table-exists-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>CREATE DATABASE db1;</code></strong>
Query OK, 1 row affected (0.01 sec)

mysql&gt; <strong class="userinput"><code>USE db1;</code></strong>
Database changed
mysql&gt; <strong class="userinput"><code>CREATE TABLE t1 (id INT PRIMARY KEY);</code></strong>
Query OK, 0 rows affected (0.03 sec)

mysql&gt; <strong class="userinput"><code>CREATE TABLE t2 (id INT PRIMARY KEY);</code></strong>
Query OK, 0 rows affected (0.20 sec)

mysql&gt; <strong class="userinput"><code>CREATE view v_t1 AS SELECT * FROM t1;</code></strong>
Query OK, 0 rows affected (0.02 sec)

mysql&gt; <strong class="userinput"><code>CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);</code></strong>
Query OK, 0 rows affected (0.00 sec)

mysql&gt; <strong class="userinput"><code>CALL sys.table_exists('db1', 't1', @exists); SELECT @exists;</code></strong>
Query OK, 0 rows affected (0.01 sec)

+-----------+
| @exists   |
+-----------+
| TEMPORARY |
+-----------+
1 row in set (0.00 sec)

mysql&gt; <strong class="userinput"><code>CALL sys.table_exists('db1', 't2', @exists); SELECT @exists;</code></strong>
Query OK, 0 rows affected (0.02 sec)

+------------+
| @exists    |
+------------+
| BASE TABLE |
+------------+
1 row in set (0.00 sec)

mysql&gt; <strong class="userinput"><code>CALL sys.table_exists('db1', 'v_t1', @exists); SELECT @exists;</code></strong>
Query OK, 0 rows affected (0.02 sec)

+---------+
| @exists |
+---------+
| VIEW    |
+---------+
1 row in set (0.00 sec)

mysql&gt; <strong class="userinput"><code>CALL sys.table_exists('db1', 't3', @exists); SELECT @exists;</code></strong>
Query OK, 0 rows affected (0.00 sec)

+---------+
| @exists |
+---------+
|         |
+---------+
1 row in set (0.00 sec)
</pre>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="sys-schema-functions"></a>26.4.5 sys Schema Stored Functions</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="sys-schema.html#sys-extract-schema-from-file-name">26.4.5.1 The extract_schema_from_file_name() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-extract-table-from-file-name">26.4.5.2 The extract_table_from_file_name() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-format-bytes">26.4.5.3 The format_bytes() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-format-path">26.4.5.4 The format_path() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-format-statement">26.4.5.5 The format_statement() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-format-time">26.4.5.6 The format_time() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-list-add">26.4.5.7 The list_add() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-list-drop">26.4.5.8 The list_drop() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-is-account-enabled">26.4.5.9 The ps_is_account_enabled() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-is-consumer-enabled">26.4.5.10 The ps_is_consumer_enabled() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-is-instrument-default-enabled">26.4.5.11 The ps_is_instrument_default_enabled() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-is-instrument-default-timed">26.4.5.12 The ps_is_instrument_default_timed() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-is-thread-instrumented">26.4.5.13 The ps_is_thread_instrumented() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-thread-account">26.4.5.14 The ps_thread_account() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-thread-id">26.4.5.15 The ps_thread_id() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-thread-stack">26.4.5.16 The ps_thread_stack() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-ps-thread-trx-info">26.4.5.17 The ps_thread_trx_info() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-quote-identifier">26.4.5.18 The quote_identifier() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-sys-get-config">26.4.5.19 The sys_get_config() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-version-major">26.4.5.20 The version_major() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-version-minor">26.4.5.21 The version_minor() Function</a></span></dt><dt><span class="section"><a href="sys-schema.html#sys-version-patch">26.4.5.22 The version_patch() Function</a></span></dt></dl>
</div>
<p>
        The following sections describe
        <a class="link" href="sys-schema.html" title="Chapter 26 MySQL sys Schema"><code class="literal">sys</code></a> schema stored functions.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-extract-schema-from-file-name"></a>26.4.5.1 The extract_schema_from_file_name() Function</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm139899463413408"></a><a class="indexterm" name="idm139899463412016"></a><p>
          Given a file path name, returns the path component that
          represents the schema name. This function assumes that the
          file name lies within the schema directory. For this reason,
          it will not work with partitions or tables defined using their
          own <code class="literal">DATA_DIRECTORY</code> table option.
        </p><p>
          This function is useful when extracting file I/O information
          from the Performance Schema that includes file path names. It
          provides a convenient way to display schema names, which can
          be more easily understood than full path names, and can be
          used in joins against object schema names.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-extract-schema-from-file-name-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">path VARCHAR(512)</code>: The full path to a
                data file from which to extract the schema name.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-extract-schema-from-file-name-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">VARCHAR(64)</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-extract-schema-from-file-name-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT extract_schema_from_file_name('/usr/local/mysql/data/world/City.ibd');</code></strong>
+-----------------------------------------------------------------------+
| extract_schema_from_file_name('/usr/local/mysql/data/world/City.ibd') |
+-----------------------------------------------------------------------+
| world                                                                 |
+-----------------------------------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-extract-table-from-file-name"></a>26.4.5.2 The extract_table_from_file_name() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463399664"></a><a class="indexterm" name="idm139899463398272"></a><p>
          Given a file path name, returns the path component that
          represents the table name.
        </p><p>
          This function is useful when extracting file I/O information
          from the Performance Schema that includes file path names. It
          provides a convenient way to display table names, which can be
          more easily understood than full path names, and can be used
          in joins against object table names.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-extract-table-from-file-name-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">path VARCHAR(512)</code>: The full path to a
                data file from which to extract the table name.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-extract-table-from-file-name-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">VARCHAR(64)</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-extract-table-from-file-name-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT extract_table_from_file_name('/usr/local/mysql/data/world/City.ibd');</code></strong>
+----------------------------------------------------------------------+
| extract_table_from_file_name('/usr/local/mysql/data/world/City.ibd') |
+----------------------------------------------------------------------+
| City                                                                 |
+----------------------------------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-format-bytes"></a>26.4.5.3 The format_bytes() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463385120"></a><a class="indexterm" name="idm139899463383728"></a><p>
          Given a value in bytes, converts it to human-readable format
          and returns a string consisting of a value and a units
          indicator. Depending on the size of the value, the units part
          is <code class="literal">bytes</code>, <code class="literal">KiB</code>
          (kibibytes), <code class="literal">MiB</code> (mebibytes),
          <code class="literal">GiB</code> (gibibytes), <code class="literal">TiB</code>
          (tebibytes), or <code class="literal">PiB</code> (pebibytes).
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-format-bytes-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">bytes TEXT</code>: The bytes value to
                format.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-bytes-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TEXT</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-bytes-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT format_bytes(512), format_bytes(18446644073709551615);</code></strong>
+-------------------+------------------------------------+
| format_bytes(512) | format_bytes(18446644073709551615) |
+-------------------+------------------------------------+
| 512 bytes         | 16383.91 PiB                       |
+-------------------+------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-format-path"></a>26.4.5.4 The format_path() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463369184"></a><a class="indexterm" name="idm139899463367792"></a><p>
          Given a path name, returns the modified path name after
          replacing subpaths that match the values of the following
          system variables, in order:
        </p><pre data-lang="none" class="programlisting">
datadir
tmpdir
slave_load_tmpdir
innodb_data_home_dir
innodb_log_group_home_dir
innodb_undo_directory
basedir
</pre><p>
          A value that matches the value of system variable
          <em class="replaceable"><code>sysvar</code></em> is replaced with the string
          <code class="literal">@@global.<em class="replaceable"><code>sysvar</code></em></code>.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-format-path-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">path VARCHAR(512)</code>: The path name to
                format.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-path-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">VARCHAR(512) CHARACTER SET utf8</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-path-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT format_path('/usr/local/mysql/data/world/City.ibd');</code></strong>
+-----------------------------------------------------+
| format_path('/usr/local/mysql/data/world/City.ibd') |
+-----------------------------------------------------+
| @@datadir/world/City.ibd                            |
+-----------------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-format-statement"></a>26.4.5.5 The format_statement() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463354336"></a><a class="indexterm" name="idm139899463352944"></a><p>
          Given a string (normally representing an SQL statement),
          reduces it to the length given by the
          <code class="literal">statement_truncate_len</code> configuration
          option, and returns the result. No truncation occurs if the
          string is shorter than
          <code class="literal">statement_truncate_len</code>. Otherwise, the
          middle part of the string is replaced by an ellipsis
          (<code class="literal">...</code>).
        </p><p>
          This function is useful for formatting possibly lengthy
          statements retrieved from Performance Schema tables to a known
          fixed maximum length.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-format-statement-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">statement LONGTEXT</code>: The statement to
                format.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-statement-configuration-options"></a>Configuration Options</h5>

</div>

</div>

</div>
<p>
            <a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a> operation
            can be modified using the following configuration options or
            their corresponding user-defined variables (see
            <a class="xref" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table">Section 26.4.2.1, “The sys_config Table”</a>):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">statement_truncate_len</code>,
                <code class="literal">@sys.statement_truncate_len</code>
              </p><p>
                The maximum length of statements returned by the
                <a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a>
                function. Longer statements are truncated to this
                length. The default is 64.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-statement-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">LONGTEXT</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-statement-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            By default, <a class="link" href="sys-schema.html#sys-format-statement" title="26.4.5.5 The format_statement() Function"><code class="literal">format_statement()</code></a>
            truncates statements to be no more than 64 characters.
            Setting <code class="literal">@sys.statement_truncate_len</code>
            changes the truncation length for the current session:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SET @stmt = 'SELECT variable, value, set_time, set_by FROM sys_config';</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT format_statement(@stmt);</code></strong>
+----------------------------------------------------------+
| format_statement(@stmt)                                  |
+----------------------------------------------------------+
| SELECT variable, value, set_time, set_by FROM sys_config |
+----------------------------------------------------------+
mysql&gt; <strong class="userinput"><code>SET @sys.statement_truncate_len = 32;</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT format_statement(@stmt);</code></strong>
+-----------------------------------+
| format_statement(@stmt)           |
+-----------------------------------+
| SELECT variabl ... ROM sys_config |
+-----------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-format-time"></a>26.4.5.6 The format_time() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463327856"></a><a class="indexterm" name="idm139899463326464"></a><p>
          Given a Performance Schema latency or wait time in
          picoseconds, converts it to human-readable format and returns
          a string consisting of a value and a units indicator.
          Depending on the size of the value, the units part is
          <code class="literal">ns</code> (nanoseconds), <code class="literal">us</code>
          (microseconds), <code class="literal">ms</code> (milliseconds),
          <code class="literal">s</code> (seconds), <code class="literal">m</code>
          (minutes), <code class="literal">h</code> (hours), <code class="literal">d</code>
          (days), or <code class="literal">w</code> (weeks).
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-format-time-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">picoseconds TEXT</code>: The picoseconds
                value to format.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-time-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TEXT</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-format-time-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT format_time(3501), format_time(188732396662000);</code></strong>
+-------------------+------------------------------+
| format_time(3501) | format_time(188732396662000) |
+-------------------+------------------------------+
| 3.50 ns           | 3.15 m                       |
+-------------------+------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-list-add"></a>26.4.5.7 The list_add() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463310736"></a><a class="indexterm" name="idm139899463309344"></a><p>
          Adds a value to a comma-separated list of values and returns
          the result.
        </p><p>
          This function and <a class="link" href="sys-schema.html#sys-list-drop" title="26.4.5.8 The list_drop() Function"><code class="literal">list_drop()</code></a>
          can be useful for manipulating the value of system variables
          such as <a class="link" href="server-administration.html#sysvar_sql_mode"><code class="literal">sql_mode</code></a> and
          <a class="link" href="server-administration.html#sysvar_optimizer_switch"><code class="literal">optimizer_switch</code></a> that take a
          comma-separated list of values.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-list-add-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_list TEXT</code>: The list to be
                modified.
              </p></li><li class="listitem"><p>
                <code class="literal">in_add_value TEXT</code>: The value to add
                to the list.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-list-add-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TEXT</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-list-add-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT @@sql_mode;</code></strong>
+----------------------------------------+
| @@sql_mode                             |
+----------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES |
+----------------------------------------+
mysql&gt; <strong class="userinput"><code>SET @@sql_mode = list_add(@@sql_mode, 'NO_ENGINE_SUBSTITUTION');</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT @@sql_mode;</code></strong>
+---------------------------------------------------------------+
| @@sql_mode                                                    |
+---------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+---------------------------------------------------------------+
mysql&gt; <strong class="userinput"><code>SET @@sql_mode = list_drop(@@sql_mode, 'ONLY_FULL_GROUP_BY');</code></strong>
mysql&gt; <strong class="userinput"><code>SELECT @@sql_mode;</code></strong>
+--------------------------------------------+
| @@sql_mode                                 |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-list-drop"></a>26.4.5.8 The list_drop() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463289984"></a><a class="indexterm" name="idm139899463288592"></a><p>
          Removes a value from a comma-separated list of values and
          returns the result. For more information, see the description
          of <a class="link" href="sys-schema.html#sys-list-add" title="26.4.5.7 The list_add() Function"><code class="literal">list_add()</code></a>
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-list-drop-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_list TEXT</code>: The list to be
                modified.
              </p></li><li class="listitem"><p>
                <code class="literal">in_drop_value TEXT</code>: The value to drop
                from the list.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-list-drop-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TEXT</code> value.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-is-account-enabled"></a>26.4.5.9 The ps_is_account_enabled() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463278288"></a><a class="indexterm" name="idm139899463276896"></a><p>
          Returns <code class="literal">YES</code> or <code class="literal">NO</code> to
          indicate whether Performance Schema instrumentation for a
          given account is enabled.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-is-account-enabled-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_host VARCHAR(60)</code>: The host name of
                the account to check.
              </p></li><li class="listitem"><p>
                <code class="literal">in_user VARCHAR(32)</code>: The user name of
                the account to check.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-account-enabled-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            An <code class="literal">ENUM('YES','NO')</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-account-enabled-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_is_account_enabled('localhost', 'root');</code></strong>
+--------------------------------------------+
| ps_is_account_enabled('localhost', 'root') |
+--------------------------------------------+
| YES                                        |
+--------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-is-consumer-enabled"></a>26.4.5.10 The ps_is_consumer_enabled() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463263632"></a><a class="indexterm" name="idm139899463262240"></a><p>
          Returns <code class="literal">YES</code> or <code class="literal">NO</code> to
          indicate whether a given Performance Schema consumer is
          enabled, or <code class="literal">NULL</code> if the argument is not a
          valid consumer name.
        </p><p>
          This function accounts for the consumer hierarchy, so a
          consumer is not considered enabled unless all consumers on
          which depends are also enabled. For information about the
          consumer hierarchy, see
          <a class="xref" href="performance-schema.html#performance-schema-consumer-filtering" title="25.4.7 Pre-Filtering by Consumer">Section 25.4.7, “Pre-Filtering by Consumer”</a>.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-is-consumer-enabled-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_consumer VARCHAR(64)</code>: The name of
                the consumer to check.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-consumer-enabled-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            An <code class="literal">ENUM('YES','NO')</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-consumer-enabled-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_is_consumer_enabled('thread_instrumentation');</code></strong>
+--------------------------------------------------+
| ps_is_consumer_enabled('thread_instrumentation') |
+--------------------------------------------------+
| YES                                              |
+--------------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-is-instrument-default-enabled"></a>26.4.5.11 The ps_is_instrument_default_enabled() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463248496"></a><a class="indexterm" name="idm139899463247104"></a><p>
          Returns <code class="literal">YES</code> or <code class="literal">NO</code> to
          indicate whether a given Performance Schema instrument is
          enabled by default.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-is-instrument-default-enabled-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_instrument VARCHAR(128)</code>: The name
                of the instrument to check.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-instrument-default-enabled-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            An <code class="literal">ENUM('YES','NO')</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-instrument-default-enabled-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_is_instrument_default_enabled('memory/innodb/row_log_buf');</code></strong>
+---------------------------------------------------------------+
| ps_is_instrument_default_enabled('memory/innodb/row_log_buf') |
+---------------------------------------------------------------+
| NO                                                            |
+---------------------------------------------------------------+
mysql&gt; <strong class="userinput"><code>SELECT ps_is_instrument_default_enabled('statement/sql/alter_user');</code></strong>
+--------------------------------------------------------------+
| ps_is_instrument_default_enabled('statement/sql/alter_user') |
+--------------------------------------------------------------+
| YES                                                          |
+--------------------------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-is-instrument-default-timed"></a>26.4.5.12 The ps_is_instrument_default_timed() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463233760"></a><a class="indexterm" name="idm139899463232368"></a><p>
          Returns <code class="literal">YES</code> or <code class="literal">NO</code> to
          indicate whether a given Performance Schema instrument is
          timed by default.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-is-instrument-default-timed-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_instrument VARCHAR(128)</code>: The name
                of the instrument to check.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-instrument-default-timed-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            An <code class="literal">ENUM('YES','NO')</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-instrument-default-timed-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_is_instrument_default_timed('memory/innodb/row_log_buf');</code></strong>
+-------------------------------------------------------------+
| ps_is_instrument_default_timed('memory/innodb/row_log_buf') |
+-------------------------------------------------------------+
| NO                                                          |
+-------------------------------------------------------------+
mysql&gt; <strong class="userinput"><code>SELECT ps_is_instrument_default_timed('statement/sql/alter_user');</code></strong>
+------------------------------------------------------------+
| ps_is_instrument_default_timed('statement/sql/alter_user') |
+------------------------------------------------------------+
| YES                                                        |
+------------------------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-is-thread-instrumented"></a>26.4.5.13 The ps_is_thread_instrumented() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463219040"></a><a class="indexterm" name="idm139899463217648"></a><p>
          Returns <code class="literal">YES</code> or <code class="literal">NO</code> to
          indicate whether Performance Schema instrumentation for a
          given connection ID is enabled, <code class="literal">UNKNOWN</code> if
          the ID is unknown, or <code class="literal">NULL</code> if the ID is
          <code class="literal">NULL</code>.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-is-thread-instrumented-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_connection_id BIGINT UNSIGNED</code>: The
                connection ID. This is a connection ID as given in the
                <code class="literal">PROCESSLIST_ID</code> column of the
                Performance Schema <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a>
                table or the <code class="literal">Id</code> column of
                <a class="link" href="sql-syntax.html#show-processlist" title="13.7.6.29 SHOW PROCESSLIST Syntax"><code class="literal">SHOW PROCESSLIST</code></a> output.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-thread-instrumented-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            An <code class="literal">ENUM('YES','NO','UNKNOWN')</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-is-thread-instrumented-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_is_thread_instrumented(43);</code></strong>
+-------------------------------+
| ps_is_thread_instrumented(43) |
+-------------------------------+
| UNKNOWN                       |
+-------------------------------+
mysql&gt; <strong class="userinput"><code>SELECT ps_is_thread_instrumented(CONNECTION_ID());</code></strong>
+--------------------------------------------+
| ps_is_thread_instrumented(CONNECTION_ID()) |
+--------------------------------------------+
| YES                                        |
+--------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-thread-account"></a>26.4.5.14 The ps_thread_account() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463199728"></a><a class="indexterm" name="idm139899463198336"></a><p>
          Given a Performance Schema thread ID, returns the
          <code class="literal"><em class="replaceable"><code>user_name</code></em>@<em class="replaceable"><code>host_name</code></em></code>
          account associated with the thread.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-thread-account-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_thread_id BIGINT UNSIGNED</code>: The
                thread ID for which to return the account. The value
                should match the <code class="literal">THREAD_ID</code> column
                from some Performance Schema
                <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a> table row.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-account-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TEXT</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-account-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_thread_account(ps_thread_id(CONNECTION_ID()));</code></strong>
+--------------------------------------------------+
| ps_thread_account(ps_thread_id(CONNECTION_ID())) |
+--------------------------------------------------+
| root@localhost                                   |
+--------------------------------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-thread-id"></a>26.4.5.15 The ps_thread_id() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463184848"></a><a class="indexterm" name="idm139899463183456"></a><p>
          Returns the Performance Schema thread ID for a given
          connection ID, or the thread ID for the current connection if
          the connection ID is <code class="literal">NULL</code>.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-thread-id-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_connection_id BIGINT UNSIGNED</code>: The
                ID of the connection for which to return the thread ID.
                This is a connection ID as given in the
                <code class="literal">PROCESSLIST_ID</code> column of the
                Performance Schema <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a>
                table or the <code class="literal">Id</code> column of
                <a class="link" href="sql-syntax.html#show-processlist" title="13.7.6.29 SHOW PROCESSLIST Syntax"><code class="literal">SHOW PROCESSLIST</code></a> output.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-id-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">BIGINT UNSIGNED</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-id-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_thread_id(260);</code></strong>
+-------------------+
| ps_thread_id(260) |
+-------------------+
|               285 |
+-------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-thread-stack"></a>26.4.5.16 The ps_thread_stack() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463169056"></a><a class="indexterm" name="idm139899463167664"></a><p>
          Returns a JSON formatted stack of all statements, stages, and
          events within the Performance Schema for a given thread ID.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-thread-stack-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_thread_id BIGINT</code>: The ID of the
                thread to trace. The value should match the
                <code class="literal">THREAD_ID</code> column from some
                Performance Schema <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a>
                table row.
              </p></li><li class="listitem"><p>
                <code class="literal">in_verbose BOOLEAN</code>: Whether to
                include <code class="literal">file:lineno</code> information in
                the events.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-stack-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">LONGTEXT CHARACTER SET latin1</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-stack-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_thread_stack(37, FALSE) AS thread_stack\G</code></strong>
*************************** 1. row ***************************
thread_stack: {"rankdir": "LR","nodesep": "0.10",
"stack_created": "2014-02-19 13:39:03", "mysql_version": "8.0.2-dmr-debug-log",
"mysql_user": "root@localhost","events": [{"nesting_event_id": "0",
"event_id": "10", "timer_wait": 256.35, "event_info": "sql/select",
"wait_info": "select @@version_comment limit 1\nerrors: 0\nwarnings: 0\nlock time:
...
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-ps-thread-trx-info"></a>26.4.5.17 The ps_thread_trx_info() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463153168"></a><a class="indexterm" name="idm139899463151776"></a><p>
          Returns a JSON object containing information about a given
          thread. The information includes the current transaction, and
          the statements it has already executed, derived from the
          Performance Schema
          <a class="link" href="performance-schema.html#events-transactions-current-table" title="25.11.7.1 The events_transactions_current Table"><code class="literal">events_transactions_current</code></a> and
          <a class="link" href="performance-schema.html#events-statements-history-table" title="25.11.6.2 The events_statements_history Table"><code class="literal">events_statements_history</code></a> tables.
          (The consumers for those tables must be enabled to obtain full
          data in the JSON object.)
        </p><p>
          If the output exceeds the truncation length (65535 by
          default), a JSON error object is returned, such as:
        </p><pre data-lang="json" class="programlisting">
{ "error": "Trx info truncated: Row 6 was cut by GROUP_CONCAT()" }
</pre><p>
          Similar error objects are returned for other warnings and
          exceptions raised during function execution.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-ps-thread-trx-info-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_thread_id BIGINT UNSIGNED</code>: The
                thread ID for which to return transaction information.
                The value should match the <code class="literal">THREAD_ID</code>
                column from some Performance Schema
                <a class="link" href="performance-schema.html#threads-table" title="25.11.16.3 The threads Table"><code class="literal">threads</code></a> table row.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-trx-info-configuration-options"></a>Configuration Options</h5>

</div>

</div>

</div>
<p>
            <a class="link" href="sys-schema.html#sys-ps-thread-trx-info" title="26.4.5.17 The ps_thread_trx_info() Function"><code class="literal">ps_thread_trx_info()</code></a> operation
            can be modified using the following configuration options or
            their corresponding user-defined variables (see
            <a class="xref" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table">Section 26.4.2.1, “The sys_config Table”</a>):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">ps_thread_trx_info.max_length</code>,
                <code class="literal">@sys.ps_thread_trx_info.max_length</code>
              </p><p>
                The maximum length of the output. The default is 65535.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-trx-info-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">LONGTEXT</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-ps-thread-trx-info-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT ps_thread_trx_info(48)\G</code></strong>
*************************** 1. row ***************************
ps_thread_trx_info(48): [
  {
    "time": "790.70 us",
    "state": "COMMITTED",
    "mode": "READ WRITE",
    "autocommitted": "NO",
    "gtid": "AUTOMATIC",
    "isolation": "REPEATABLE READ",
    "statements_executed": [
      {
        "sql_text": "INSERT INTO info VALUES (1, \'foo\')",
        "time": "471.02 us",
        "schema": "trx",
        "rows_examined": 0,
        "rows_affected": 1,
        "rows_sent": 0,
        "tmp_tables": 0,
        "tmp_disk_tables": 0,
        "sort_rows": 0,
        "sort_merge_passes": 0
      },
      {
        "sql_text": "COMMIT",
        "time": "254.42 us",
        "schema": "trx",
        "rows_examined": 0,
        "rows_affected": 0,
        "rows_sent": 0,
        "tmp_tables": 0,
        "tmp_disk_tables": 0,
        "sort_rows": 0,
        "sort_merge_passes": 0
      }
    ]
  },
  {
    "time": "426.20 us",
    "state": "COMMITTED",
    "mode": "READ WRITE",
    "autocommitted": "NO",
    "gtid": "AUTOMATIC",
    "isolation": "REPEATABLE READ",
    "statements_executed": [
      {
        "sql_text": "INSERT INTO info VALUES (2, \'bar\')",
        "time": "107.33 us",
        "schema": "trx",
        "rows_examined": 0,
        "rows_affected": 1,
        "rows_sent": 0,
        "tmp_tables": 0,
        "tmp_disk_tables": 0,
        "sort_rows": 0,
        "sort_merge_passes": 0
      },
      {
        "sql_text": "COMMIT",
        "time": "213.23 us",
        "schema": "trx",
        "rows_examined": 0,
        "rows_affected": 0,
        "rows_sent": 0,
        "tmp_tables": 0,
        "tmp_disk_tables": 0,
        "sort_rows": 0,
        "sort_merge_passes": 0
      }
    ]
  }
]
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-quote-identifier"></a>26.4.5.18 The quote_identifier() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463127776"></a><a class="indexterm" name="idm139899463126384"></a><p>
          Given a string argument, this function produces a quoted
          identifier suitable for inclusion in SQL statements. This is
          useful when a value to be used as an identifier is a reserved
          word or contains backtick (<code class="literal">`</code>) characters.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-quote-identifier-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            <code class="literal">in_identifier TEXT</code>: The identifier to
            quote.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-quote-identifier-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TEXT</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-quote-identifier-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT quote_identifier('plain');</code></strong>
+---------------------------+
| quote_identifier('plain') |
+---------------------------+
| `plain`                   |
+---------------------------+
mysql&gt; <strong class="userinput"><code>SELECT quote_identifier('trick`ier');</code></strong>
+-------------------------------+
| quote_identifier('trick`ier') |
+-------------------------------+
| `trick``ier`                  |
+-------------------------------+
mysql&gt; <strong class="userinput"><code>SELECT quote_identifier('integer');</code></strong>
+-----------------------------+
| quote_identifier('integer') |
+-----------------------------+
| `integer`                   |
+-----------------------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-sys-get-config"></a>26.4.5.19 The sys_get_config() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463114048"></a><a class="indexterm" name="idm139899463112656"></a><p>
          Given a configuration option name, returns the option value
          from the <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table, or
          the provided default value (which may be
          <code class="literal">NULL</code>) if the option does not exist in the
          table.
        </p><p>
          If <a class="link" href="sys-schema.html#sys-sys-get-config" title="26.4.5.19 The sys_get_config() Function"><code class="literal">sys_get_config()</code></a> returns the
          default value and that value is <code class="literal">NULL</code>, it is
          expected that the caller is able to handle
          <code class="literal">NULL</code> for the given configuration option.
        </p><p>
          By convention, routines that call
          <a class="link" href="sys-schema.html#sys-sys-get-config" title="26.4.5.19 The sys_get_config() Function"><code class="literal">sys_get_config()</code></a> first check
          whether the corresponding user-defined variable exists and is
          non-<code class="literal">NULL</code>. If so, the routine uses the
          variable value without reading the
          <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table. If the
          variable does not exist or is <code class="literal">NULL</code>, the
          routine reads the option value from the table and sets the
          user-defined variable to that value. For more information
          about the relationship between configuration options and their
          corresponding user-defined variables, see
          <a class="xref" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table">Section 26.4.2.1, “The sys_config Table”</a>.
        </p><p>
          If you want to check whether the configuration option has
          already been set and, if not, use the return value of
          <code class="literal">sys_get_config()</code>, you can use
          <code class="literal">IFNULL(...)</code> (see example later). However,
          this should not be done inside a loop (for example, for each
          row in a result set) because for repeated calls where the
          assignment is needed only in the first iteration, using
          <code class="literal">IFNULL(...)</code> is expected to be significantly
          slower than using an <code class="literal">IF (...) THEN ... END
          IF;</code> block (see example later).
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-sys-get-config-parameters"></a>Parameters</h5>
</div>
</div>
</div>

<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
                <code class="literal">in_variable_name VARCHAR(128)</code>: The
                name of the configuration option for which to return the
                value.
              </p></li><li class="listitem"><p>
                <code class="literal">in_default_value VARCHAR(128)</code>: The
                default value to return if the configuration option is
                not found in the <code class="literal">sys_config</code> table.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-sys-get-config-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">VARCHAR(128)</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-sys-get-config-example"></a>Example</h5>

</div>

</div>

</div>
<p>
            Get a configuration value from the
            <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table, falling back
            to 128 as the default if the option is not present in the
            table:
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT sys.sys_get_config('statement_truncate_len', 128) AS Value;</code></strong>
+-------+
| Value |
+-------+
| 64    |
+-------+
</pre><p>
            One-liner example: Check whether the option is already set;
            if not, assign the <code class="literal">IFNULL(...)</code> result
            (using the value from the
            <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a> table):
          </p><pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SET @sys.statement_truncate_len =</code></strong>
    -&gt; <strong class="userinput"><code>IFNULL(@sys.statement_truncate_len,</code></strong>
    -&gt; <strong class="userinput"><code>       sys.sys_get_config('statement_truncate_len', 64));</code></strong>
</pre><p>
            <code class="literal">IF (...) THEN ... END IF;</code> block example:
            Check whether the option is already set; if not, assign the
            value from the <a class="link" href="sys-schema.html#sys-sys-config" title="26.4.2.1 The sys_config Table"><code class="literal">sys_config</code></a>
            table:
          </p><pre data-lang="sql" class="programlisting">
IF (@sys.statement_truncate_len IS NULL) THEN
  SET @sys.statement_truncate_len = sys.sys_get_config('statement_truncate_len', 64);
END IF;
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-version-major"></a>26.4.5.20 The version_major() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463077856"></a><a class="indexterm" name="idm139899463076464"></a><p>
          This function returns the major version of the MySQL server.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-version-major-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-version-major-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TINYINT UNSIGNED</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-version-major-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT VERSION(), version_major();</code></strong>
+---------------------+-----------------+
| VERSION()           | version_major() |
+---------------------+-----------------+
| 8.0.2-dmr-debug-log |               8 |
+---------------------+-----------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-version-minor"></a>26.4.5.21 The version_minor() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463067456"></a><a class="indexterm" name="idm139899463066064"></a><p>
          This function returns the minor version of the MySQL server.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-version-minor-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-version-minor-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TINYINT UNSIGNED</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-version-minor-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT VERSION(), version_minor();</code></strong>
+---------------------+-----------------+
| VERSION()           | version_minor() |
+---------------------+-----------------+
| 8.0.2-dmr-debug-log |               0 |
+---------------------+-----------------+
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="sys-version-patch"></a>26.4.5.22 The version_patch() Function</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm139899463057056"></a><a class="indexterm" name="idm139899463055664"></a><p>
          This function returns the patch release version of the MySQL
          server.
</p>
<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h5 class="title"><a name="sys-version-patch-parameters"></a>Parameters</h5>
</div>
</div>
</div>
<p>
            None.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-version-patch-return-value"></a>Return Value</h5>

</div>

</div>

</div>
<p>
            A <code class="literal">TINYINT UNSIGNED</code> value.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="sys-version-patch-example"></a>Example</h5>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">
mysql&gt; <strong class="userinput"><code>SELECT VERSION(), version_patch();</code></strong>
+---------------------+-----------------+
| VERSION()           | version_patch() |
+---------------------+-----------------+
| 8.0.2-dmr-debug-log |               2 |
+---------------------+-----------------+
</pre>
</div>

</div>

</div>

</div>

</div>
<div class="copyright-footer">

</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="performance-schema.html">Prev</a></td>
<td width="20%" align="center"><a accesskey="u" href="">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="connectors-apis.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter 25 MySQL Performance Schema</td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top">Chapter 27 Connectors and APIs</td>
</tr>
</table>
</div>
</body>
</html>
